GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes basic confusion for dealing with assertions!! 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 "basic confusion for dealing with assertions!!" Watch "basic confusion for dealing with assertions!!" New topic
Author

basic confusion for dealing with assertions!!

anjali desh
Ranch Hand

Joined: Aug 04, 2005
Posts: 32
I have got this very basic doubt for questions involving assertions.Will the question explicitely tell that the assertions are enabled or not??? And if it is not mentioned ,should we assume the default behavior that assertions are disabled and select the corresponding output?



Should we select the outptut "finished" assuming that assertions are disabled?
Sravan Kumar
Ranch Hand

Joined: Sep 11, 2005
Posts: 121
The question will say if assertions are enabled or disabled. If at all, it doesn't I would assume assertions are enabled and answer it because the question is about assertions.

But, this confusion would not be effected. The question will be very clear.


keep smilin :: sravan<br /><a href="http://sravanpens.blogspot.com" target="_blank" rel="nofollow">I scribble here</a>
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Hi Anjali,
Yes, as far as I think you should stuck on to the default behaviour of the assertions until and unless it is explicitly stated that code is compiled and run with assertions enabled. Otherwise you should just ignore assertions.
But mind you if you are going for SCJP 5.0, so keep in mind that in JDK 1.5 assertions are automatically enabled while compiling, ie. you dont have to use the flag -source 1.4 or -source 1.5.


Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
 
GeeCON Prague 2014
 
subject: basic confusion for dealing with assertions!!