When I use javac HandleEvent.java, the following message appear. What does this mean?
Note: HandleEvent.java uses or overrides a deprecated API
Note: Recompile with -deprecation for details.
Printable View
When I use javac HandleEvent.java, the following message appear. What does this mean?
Note: HandleEvent.java uses or overrides a deprecated API
Note: Recompile with -deprecation for details.
Messages are self explanatoryQuote:
Originally Posted by ychhuong
If your program calls any deprecated methods -the compiler displays a warning.
Most of the new compilers will warn you when a program overrides a deprecated method.
To get information about each source file's use of deprecated methods, use the -deprecation option of the Java compiler.
For details of deprecated classes,methods etc go here
http://java.sun.com/j2se/1.4.2/docs/...ated-list.html
What are deprecated methods?
oh cmon...Quote:
Originally Posted by ychhuong
http://www.catb.org/~esr/faqs/smart-questions.html
Deprecated methods: some methods that sun wants us to stop using, they came up with better replacements, check Java Doc
So it means when we see message about deprecated method, we should not use that methods. How can i find the equivalent method of depreated method? If i still using these methods, will it run properly or not?
You will find all of that in JavaDoc:
JDoc
10:1 it's Component.show(). Who's taking?
Yap, if I'm not mistaken, deprecated methods can be defined as old methods that have been substituted with other methods. For example:
Component.show(); is now declared Component.setVisible(true);
I don't really know, but if I'm not mistaken, it depends on the version of JDK, if u use the older one, u may not find the errors while compiling the program with deprecated methods.
No, this is actually incorrect. Deprecated items, in Java, are those whose use Sun discourages, for whatever reason. For example, there are some methods in Thread that are deprecated without replacement, because they can lead to program corruption when used in special circumstances.Quote:
Originally Posted by steven_luck1
This is correct, because items only become deprecated when Java releases a new version of the JDK. This doesn't mean, however, that it's acceptable to just use an older JDK: the method is still deprecated, it's just that it is not marked as such and the compiler thus doesn't know it.Quote:
I don't really know, but if I'm not mistaken, it depends on the version of JDK, if u use the older one, u may not find the errors while compiling the program with deprecated methods.