System class Methods in Java Part -I

java.lang.System

The System class contains several useful class fields and methods. It cannot be instantiated. Among the facilities provided by the System, class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.


Some of the Methods of System class.


System.arraycopy()This method copies an array from the specified source array, beginning at the specified position, to the specified position of the destination array.


System.clearProperty()This method removes the system property indicated by the specified key.


System.console()Returns the unique Console object associated with the current Java virtual machine, if any.


System.currentTimeMillis()This method returns the current time in milliseconds.


System.errThe "standard" error output stream. This stream is already open and ready to accept output data.


System.exit() This method terminates the currently running Java Virtual Machine.


System.gc()This method runs the garbage collector in the Java Virtual Machine.


System.getenv()This method gets the value of the specified environment variable.


System.getLogger()This method returns an instance of Logger for the caller's use.


System.getProperties()This method determines the current system properties.


System.getProperty()This method gets the system property indicated by the specified key.


System.getSecurityManager()This method gets the system-wide security manager.


System.identityHashCode() This method returns the same hash code for the given object as would be returned by the default method hashCode(), whether or not the given object's class overrides hashCode().


System.inThe "standard" input stream. 


Some more Methods of System class


No comments:

Post a Comment