This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 179


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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32507
    
214

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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
 
jQuery in Action, 3rd edition