But, in the possible (right) answers, the switch -ea is never used (and it is why my own answer is declared wrong). As assertions are disabled by default how the code can "uses the assertion facility" if the switch is not present?You have just written a Java class named AssertTest.java that uses the assertion facility. Write down the syntax for compiling this program using Javac.
[Do not write the classpath or any other switches, just use the one/ones that is/are absolutely needed. Start with: javac ...]
About question com.enthuware.ets.scjp.v6.2.27 (hoping reference is right)
Moderator: admin
About question com.enthuware.ets.scjp.v6.2.27 (hoping reference is right)
The question is:
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About question com.enthuware.ets.scjp.v6.2.27 (hoping reference is right)
The question only asks about how to compile it without using any switches that not necessary. -ea is required to enable assertions at runtime. It has nothing to do with compilation. In other words, -ea doesn't apply to javac. It applies to java.
HTH,
Paul.
HTH,
Paul.
Who is online
Users browsing this forum: Bing [Bot] and 10 guests