Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javacaps mock 2 Q:8

 
Haining Mu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Answer: B,C
I think it is better to change question "what do you see" to "What is the result" , I didn't see anything on my screen for "Runtime error"
 
Rehan Malik
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Haining Mu:
[B]
Answer: B,C
I think it is better to change question "what do you see" to "What is the result" , I didn't see anything on my screen for "Runtime error"[/B]


You would see the "ArrayOutOfBoundsException" on the screen however, you wouldn't see "Runtime error". Runtime error is EXACTLY what happens when you try to run the program. A runtime error occurs. The question might be a little misleading since it asks what appears on the "screen". If we just look at it strictly, then ONLY "ArrayOutOfBoundsException" appears to be a valid answer.
correct me if i'm wrong
 
Muhammad Farooq
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you can define a constructor with hte return data type.
--Farooq
 
Muhammad Farooq
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please disregard my last posting, I got it now thats the method not the constructor.
--Farooq
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic