• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MasterExam question on Assertions

 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have edited your message. Please KeepItDown.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me it should be True


Why do you want to throw errors in your program when calling assert condition; will suffice ?
 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yup, I agree with simran.
 
Simran Dass
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



for Neha .
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I misread your question. Yes, Errors are not meant to be thrown explicitly
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic