Deprecated Methods
The first column in the following table lists the methods in theSystem
class that are deprecated in the JDK 1.1. The second column lists alternatives for those methods:
Deprecated Methods Alternatives getenv(String)
getProperty(String)
The
getenv
method has been out of use for several releases of the JDK. The 1.1 release formalizes this change by deprecating the method. Programmers should useProperties
to store information between invocations of a program. Setting Up and Using Properties talks about how to use theProperties
class and Managing Locale-Sensitive Data shows you how to use properties to help internationalize your Java programs.New Methods
The following methods were added to theSystem
class for the JDK 1.1:ThesetErr(PrintStream) setIn(InputStream) setOut(PrintStream) runFinalizersOnExit(boolean) identityHashCode(Object)setErr
,setIn
, andsetOut
methods reassign the standard error, standard input and standard output streams, respectively. The Standard I/O Streams in this lesson discusses these streams.
runFinalizersOnExit
determines whether or notfinalize
methods are invoked when a program is exiting. By default, this is turned off. Cleaning Up Unused Objects talks aboutfinalize
methods and garbage collection in more detail.
identityHashCode
returns a hash code for the specified object. Hash codes are not covered in this tutorial. Use the online API documentation for theObject
class for information.