aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes is this a proper mock question for the exam? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "is this a proper mock question for the exam?" Watch "is this a proper mock question for the exam?" New topic
Author

is this a proper mock question for the exam?

gianni ipez
Ranch Hand

Joined: Jan 02, 2007
Posts: 65
Hello,
I'm doing several mock exams.
Could be the following one be a proper mock question for the exam?


Which of the following declarations of robustMethod(int[] intArray) are valid in a subclass of the above class?

a) public void robustMethod(int[] intArray)
b) public void robustMethod(int[] intArray) throws Exception
c) public void robustMethod(int[] intArray) throws Throwable
d) public void robustMethod(int[] intArray) throws Error
e) public void robustMethod(int[] intArray) throws RuntimeException

I studied that it's not usual to throw errors, so I think this question is a bit misleading. Am I right?
Is it possible to get questions like this?
By the way the answer is
a),d),e)

Thanks,
Gianni
Srinivasan thoyyeti
Ranch Hand

Joined: Feb 15, 2007
Posts: 557
Hi gianni,

Gianni:I studied that it's not usual to throw errors, so I think this question is a bit misleading. Am I right?


1.There is no need to bother about Errors or RuntimeExceptions.
1.1 Parents and Child methods can optionally declare RuntimeExceptions or Errors of their own.

2.Coming to checked-exceptions:
1.1 If parent methd has one, then
1.1.1 Child method may or may not throw that exeption
1.1.2 Child method should not declare any additional exceptions.

Hope it helps you avoid ambiguity.
[ April 02, 2007: Message edited by: Srinivasan thoyyeti ]

Thanks & Regards, T.Srinivasan
SCWCD 1.4(89%), SCJP 5.0(75%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is this a proper mock question for the exam?