View Full Version : method has been deprecated

02-23-2004, 01:31 AM
Im currently making a java program that uses pipes for input and output between the methods of a program (pipes make programs operate much more efficiently, hence output of one method is direct input to another, without having to first go through some other barrier).

For one of my imported classes, one of the methods from it is given a warning at compilation by the compiler ( no probs with syntax though) that the method has been deprecated. What exactly does this mean ???

02-23-2004, 09:35 AM
It means the good people of Sun have decided that the method you used was a mistake and they have a newer better way to do what you want to do. Usually if you check the documentation for that class it'll say what methods are deprecated and what you should use instead.
For example, the stop() method is deprecated in the Thread class (java.lang) because it might stop a thread while it is in the middle of doing something critical, and instead now they say that a thread should be stopped only when it's run() method returns.