This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am compiling a java app in dos command line: javac Test.java then it show me this message: Note: Test.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. If i compile it user this: javac -d Test.java It has not problem at all! Can anyone explain why i got this message? I appreciate for you help! Cheers! Mindy
This has been answered before but I want to get over the 500 posts hump by COB Deprecated in this context means that use of the method you are calling is no longer recommended and obsolete (although you may still do so if you insist). You should go to the JavaDoc and see what the recommended replacement for the obsolete API is and use that instead. The -deprecated compile option just tells the compiler to shut up about deprecated APIs already (You know what you're doing, right? )
Deprecated means certain old ways of doing things,no longer recommended and might not be supported in a future major release. To help you convert your programs well ahead of time, the Java compiler warns you whenever you compile a program that uses deprecated API. To see a list of places where your program uses deprecated API, use javac -deprecation. You might see many warnings. Don't panic! Your program will continue to work for a long time. However, you might want to make plans to convert it. And any new code you write should use the new API, if at all possible.