|
-
Feb 6th, 2006, 09:03 PM
#1
Thread Starter
Addicted Member
Compile with deprecation
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.
-
Feb 7th, 2006, 03:29 AM
#2
Addicted Member
Re: Compile with deprecation
 Originally Posted by ychhuong
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 explanatory
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
#Appreciate others by rating good posts !!
#The Software Peter Principle is in operation when unwise developers "improve" and "generalize" the software until they themselves can no longer understand it, then the project slowly dies.
#People who are still ignorant of their ignorance are dangerous.
-
Feb 7th, 2006, 11:24 PM
#3
Thread Starter
Addicted Member
Re: Compile with deprecation
What are deprecated methods?
-
Feb 8th, 2006, 05:00 AM
#4
Addicted Member
Re: Compile with deprecation
 Originally Posted by ychhuong
What are deprecated methods?
oh cmon...
http://www.catb.org/~esr/faqs/smart-questions.html
#Appreciate others by rating good posts !!
#The Software Peter Principle is in operation when unwise developers "improve" and "generalize" the software until they themselves can no longer understand it, then the project slowly dies.
#People who are still ignorant of their ignorance are dangerous.
-
Feb 8th, 2006, 08:10 AM
#5
Re: Compile with deprecation
Deprecated methods: some methods that sun wants us to stop using, they came up with better replacements, check Java Doc
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Feb 8th, 2006, 11:54 PM
#6
Thread Starter
Addicted Member
Re: Compile with deprecation
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?
-
Feb 9th, 2006, 07:28 AM
#7
Re: Compile with deprecation
You will find all of that in JavaDoc:
JDoc
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Feb 9th, 2006, 07:51 AM
#8
Re: Compile with deprecation
10:1 it's Component.show(). Who's taking?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Mar 18th, 2006, 12:20 AM
#9
Junior Member
Re: Compile with deprecation
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.
The only thing for the triumph of evil is for a good man to do nothing
-
Mar 18th, 2006, 03:40 AM
#10
Re: Compile with deprecation
 Originally Posted by steven_luck1
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);
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.
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.
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|