This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes assertions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "assertions?" Watch "assertions?" New topic
Author

assertions?

srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252


Hi ,
in case of assertions we cant assert a value which is a argument of public method where as this is not applicable for private method!!!

so a is incorrect..whereas d is correct...

but i have doubt regarding other 2..both seems to be correct ...
answer given is b and d..why not c???

srikanth


Thanks & Regards<br /> <br />-Srikanth
Boobalan Shanmugam
Greenhorn

Joined: Sep 22, 2005
Posts: 1
The code should function in the same manner regardless of assertions are enabled or disabled. In option c, if assertion is enabled the method will be called and do some changes, which will not happen if the assertion are disabled, which causes the code to behave in a assertion dependent manner.
 
 
subject: assertions?
 
Similar Threads
Assertion question
Assertions Q
Dan's questions on assertions: inconsistent?
Contradiction between two Qs - Help!!!
dan exam doubt 12