Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flow Control Query Refernce Cert Pal

 
Sahil Kapoor
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

One of the correct options is

Some statement may result in a RunTimeException

I am not getting it ???
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sahil Kapoor
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"...
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have other Bugs in cert pal tooo......Yet not posted !!!
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure Deepak !!!
Its my Pleasure !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic