This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes MasterExam question on Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "MasterExam question on Assertions" Watch "MasterExam question on Assertions" New topic
Author

MasterExam question on Assertions

Simran Dass
Ranch Hand

Joined: Jan 09, 2010
Posts: 183
The question is : -

Which statements are ture? I cannot understand why the following statement is FALSE
"Never throw an AssertionError explicitly."

According to me it should be True


Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I have edited your message. Please KeepItDown.


[My Blog]
All roads lead to JavaRanch
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

According to me it should be True


Why do you want to throw errors in your program when calling assert condition; will suffice ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Simran Dass
Ranch Hand

Joined: Jan 09, 2010
Posts: 183

Deepak that is what I'm saying.
Why would I want to throw AssertionError explicitly. This is why the statement :-

"Never throw an AssertionError explicitly " should be true.
Neha Daga
Ranch Hand

Joined: Oct 30, 2009
Posts: 504
yup, I agree with simran.


SCJP 1.6 96%
Simran Dass
Ranch Hand

Joined: Jan 09, 2010
Posts: 183



for Neha .
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

I guess I misread your question. Yes, Errors are not meant to be thrown explicitly
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MasterExam question on Assertions
 
Similar Threads
i need JSP code
question on hascode()
Query on wrapper constants
Need help on calling javascript without any handler from JSP..
Connection con;