java -enableassertions Asserttest.java
But i am getting the following compilation error:
Exception in thread "main" java.lang.NoClassDefFoundError: Asserttest/java
Please tell me the right command. Thanks in advance.
Mike Simmons wrote:I'll give you a hint: your problem really has nothing to do with assertions.
How would you run this program without enabling assertions?
Actually i just want to check the functionality of assert keyword. I read that by default assertions are disabled. we need to enable them and that command was given. But it is not working for my code. Can you now give me some solution??
Campbell Ritchie wrote:Another hint: Look at the Java™ Tutorials and use ctrl-F "Run the Program" which takse you to the end of the page, where you see exactly which instruction you should use after "java". Note you miss out the extension.
In Run The Program, no assertions related stuff is given. my code is saved using Asserttest.java. Can you give me the exact command for it??