File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes assert keydword  usage. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "assert keydword  usage." Watch "assert keydword  usage." New topic
Author

assert keydword usage.

Zkr Ryz
Ranch Hand

Joined: Jan 04, 2001
Posts: 187
O tried to use the new assert keyword but my code doesn't even compile.
I try a simpler code and still dont compile, could you tell me what's wrong here ?
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
yes..
you are correct. i also get the same error. i tried jdk1.4.0_03 and jdk1.4.1_01 both. none of them works.
regards
maulin
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Try
javac -source 1.4 X.java
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
and after it compiles run it with java -ea ( or -enableassertions)
[ December 23, 2002: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
You might like to take a look at The September Newsletter.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Zkr Ryz
Ranch Hand

Joined: Jan 04, 2001
Posts: 187
Ok , now I got it.
I don't know, this seems kind of odd to me , what is the reason of this -source flag when already have a -target flag ??
Anyway I've never use them before, and now I guess I should start

Thank you all for your answers.
Regards Zkr Ryz.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
thanks all.
i will try it when i get back to work
Mary X'Mas.
regards
maulin
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
what is the reason of this -source flag when already have a -target flag ??
Take a look at The javac Documentation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: assert keydword usage.
 
Similar Threads
Program with assert does not compile
Assertion Doubt.
assertion doubt
assertion doubt
Error in code when using assertion