IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Enabling assertion in eclipse

2 posters

Go down

Enabling assertion in eclipse Empty Enabling assertion in eclipse

Post by BIT0104-ANIK Mon May 24, 2010 5:50 am

I think all of us(who have tried to compile and run the code in chapter 13, page 307). Here output won't be same as the book states.
The problem is..assertion is not by default enabled in eclipse. So your program would run to negative values without throwing assertion exception.
Don't worry..there is always a way.
Go to eclipse Window>preference>java>installed JRE's>
select the one and click edit. In the window that appears, in the text box named 'Default VM arguments' write "-ea", without the quote. save it and close it.
Now run that program again, isn't it showing the result same as the book?
BIT0104-ANIK
BIT0104-ANIK
Administrator
Administrator

Course(s) :
  • BIT

Blood Group : O+
Posts : 423
Points : 699

http://anikstech.blogspot.com

Back to top Go down

Enabling assertion in eclipse Empty Re: Enabling assertion in eclipse

Post by BIT0122-Amit Mon May 24, 2010 2:51 pm

in chapter 13, page 307).
which book? Neutral
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Enabling assertion in eclipse Empty Re: Enabling assertion in eclipse

Post by BIT0104-ANIK Tue May 25, 2010 12:11 am

Java, The Complete Reference 7th edition by Herbert Schildt. thnx.
BIT0104-ANIK
BIT0104-ANIK
Administrator
Administrator

Course(s) :
  • BIT

Blood Group : O+
Posts : 423
Points : 699

http://anikstech.blogspot.com

Back to top Go down

Enabling assertion in eclipse Empty Re: Enabling assertion in eclipse

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum