• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Assertion topic

 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above program is from MasterExam(but slightly modified)
In the above program assert statements are false so bar() and foo() methods should be called

but why the output is done??

can anyone explain???
 
Raju Champaklal
Ranch Hand
Posts: 521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because when you ran the program you did not enable the assertions
 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this java -ea Test
 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh k Thank you guys..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic