File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Flow Control Query   Refernce Cert Pal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Flow Control Query   Refernce Cert Pal" Watch "Flow Control Query   Refernce Cert Pal" New topic
Author

Flow Control Query Refernce Cert Pal

Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316

One of the correct options is

Some statement may result in a RunTimeException

I am not getting it ???

SCJP 6.0 96%

(Connecting the Dots ....)
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Hi Sahil,

Some statement may result in a RuntimeException


This is a typo. It is supposed to be Error not Exception.

Asserting false explicitly will throw an AssertionError


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Yess,,,,, I am always precise about Error and Exception.....But Cert pal seems to be using it synonymously

Does SCJP has such conventions ???
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Does SCJP has such conventions ???


Nope. The SCJP is pretty clear about Errors Vs Exceptions.

But Cert pal seems to be using it synonymously


The questions were swept once to remove this ambiguity, thereby introducing this typo

ahh fixing bugs / correcting sentences are all the same. Try to fix something and manage to introduce another problem

Thanks for bringing this up though.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Generally if the question states "results in a run time exception", you can assume anything that's Throwable i.e. Exception and Error both. When the question means only java.lang.Exception, the e in Exception will be upper case i.e. "results in a run time Exception". I don't remember exactly if this is given in the K&B book or Bert said it in the forums or I read it anywhere else, so this info cannot be completely relied on. But generally any exception at runtime will only have an option as "An exception occurs at runtime" so you don't have to worry if its an Exception or Error. You won't have two options as "An Exception occurs at runtime" and "An Error occurs at runtime"...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Deepak Bala wrote:Thanks for bringing this up though.

Won't you thank me this time

On a serious note, we are here to help with errors in questions. I'll take some free time to take the exams in your mock to see if I find any errors...
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Generally if the question states "results in a run time exception", you can assume anything that's Throwable i.e. Exception and Error both.


I am not sure if that is the case. I remember the exam identifying a runtime exception as any Exception / RuntimeException but not a Throwable or Error. Errors and Throwables are asked about explicitly but the exam usually does not concentrate on them.

Won't you thank me this time


Of course I will.

I'll take some free time to take the exams


Thanks. After a few sweeps I think this is the only problem that remains. But you never know eh ?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Deepak Bala wrote:
Generally if the question states "results in a run time exception", you can assume anything that's Throwable i.e. Exception and Error both.

I am not sure if that is the case. I remember the exam identifying a runtime exception as any Exception / RuntimeException but not a Throwable or Error. Errors and Throwables are asked about explicitly but the exam usually does not concentrate on them.

I'm quite sure that I read that statement somewhere, can't remember where. Anyway an Error can occur at runtime at any point. A simple object instantiation can lead to OutOfMemoryError. But as you said the exam doesn't focus much on Throwables and Errors. My point was there is generally no need to worry about the right answer confusing you over Error or Exception. Like if this code is on the exam
If the question states that the code is run with assertions enabled, but there won't be two separate options which say
A. An exception is thrown at runtime
B. An AssertionError is thrown at runtime

AssertionError is a subclass of Error, but still it is an exception class. So the question becomes ambiguous in this case...
Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
I have other Bugs in cert pal tooo......Yet not posted !!!
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

Sure. Post it here or send me a PM. We can fix it if it is a bug or clarify the point if it was not understood.
Sahil Kapoor
Ranch Hand

Joined: Sep 12, 2009
Posts: 316
Sure Deepak !!!
Its my Pleasure !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Flow Control Query Refernce Cert Pal
 
Similar Threads
Assertions
equal method on collection
Assert Question
Assert statements
Assertion