CSC 108H

What's a "deprecated API"?

Sometimes when you compile a program, you'll get error messages that say something like:

        Note: Program.java uses a deprecated API.

What does that mean?

You "deprecate" something if you don't much care for it and recommend to others that they should not use it. The compiler is telling you that current Java programming practice is not to use the standard library classes or methods that you used in your program, because there are newer ones that are considered better.

Your program will still work

Using deprecated APIs is not a disaster: you can still use your program. If your program is intended to have a long lifetime -- for example, if you plan to sell it or distribute it on the Internet -- then you should replace the deprecated API with the more up-to-date version.

Finding out more about the problem

When you work with the JDK, you can recompile with the "-deprecation" option to find out more about exactly what is deprecated. In CodeWarrior, you can use the Application Settings command in the File menu to control deprecation warnings.

Sun's Java documentation includes a good deal of information about what has been deprecated during the progress of Java, but you shouldn't need to refer to it during CSC108H.