aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt with assertions - Kathy Sierra chapter 10 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt with assertions - Kathy Sierra chapter 10" Watch "Doubt with assertions - Kathy Sierra chapter 10" New topic
Author

Doubt with assertions - Kathy Sierra chapter 10

Jacob Sonia
Ranch Hand

Joined: Jun 28, 2009
Posts: 174


if i use
javac -source 6 Antique.java
java Antique

why does it compile...if we specify source 6...aren't assertions enabled by default then
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30352
    
150

Jacob,
Assertions are disabled by default. And the code will compile regardless of whether assertions are enabled. The question then is whether it will run or throw an exception due to the assertion.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt with assertions - Kathy Sierra chapter 10