Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:23:28+00:00 2026-06-14T18:23:28+00:00

I am reading about the Oracle Java SE 7 Certified Programmer Level 2. I

  • 0

I am reading about the Oracle Java SE 7 Certified Programmer Level 2. I looked at the sample questions on their website and found this one which answer I cannot understand.

import java.util.*; 
public class MyScan { 
   public static void main(String[] args) { 
      String in = "1 a 10 . 100 1000"; 
      Scanner s = new Scanner(in); 
      int accum = 0; 
      for(int x = 0; x < 4; x++) { 
        accum += s.nextInt(); 
      } 
      System.out.println(accum); 
   } 
} 

What is the result?
A) 1
B) 11
C) 111
D) 1111
E) Compilation fails.
F) Class2 has-a
Class1.
G) An exception is thrown at run time

The right answer is F. What does that answer mean?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:23:30+00:00Added an answer on June 14, 2026 at 6:23 pm

    You would receive an Exception at Run Time.

     java.util.InputMismatchException
    

    It is because, it fails during second iteration when it tries to match a

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading the official Oracle documentation about Concurrency in Java and I was
I am reading about the DAO design pattern on Oracle's website and I'm trying
I was looking for something about reading zip-archives via RandomAccessFile. So, I found this
i am reading this article about saving trees into database http://www.dba-oracle.com/t_sql_patterns_trees.htm But i don't
Reading about the G.729 codec , I found this interesting tidbit about Comfort Noise
I recently was reading about Oracle Index Organized Tables (IOTs) but am not sure
I'm reading the tutorial about configuring JSON for RESTful web services: https://blogs.oracle.com/enterprisetechtips/entry/configuring_json_for_restful_web JAXB defines
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome
Reading about Django, I saw this: http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#ref-contrib-admin - the fancy simple to use admin
I am reading about Direct-Path INSERT in oracle documentation Loading Tables It is written

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.