| |
|
Define the System Class in Java? Question Posted on 07 Apr 2021 Home >> Java >> Core Java >> Define the System Class in Java? |
Define the System Class in Java?
System Class is the ore class in Java. And we are not able to override its behavior throgh inheritance. And we cannot instantiate this class as it doesnot have any public constructors. Hence all of its methods are static here in System Class. System Class of Java contains several useful class fields and methods. And this will provides many facilities like standard input,standard output and the error output streams. Java System class comes in different modules of JAVA.BASE and in package of JAVA.LANG. And in Java System class we have 3 different types of field and 28 different types of methods. Below are the list of 3 fields:-
(1)static PrintStrean
(2)static InputStream
(3)static PrintStream
And below are the 28 methods:-
(1)arraycopy(object src, int srcPos, object dest, int destPos, int length)
(2)clearProperty(String key)
(3)console()
(4)currentTimeMillis()
(5)exit(int status)
(6)gc()
(7)getenv()
(8)getLogger(String name, RecourseBundle)
(9)getLogger(String name)
(10)getenv(String name)
(11)getProperties()
(12)getProperty(String key)
(13)getProperty(String key,String def)
(14)getSecurityManager()
(15)identityHashCode(Object x)
(16)inheritedChannel() throws IOException
(17)lineSeparator()
(18)load(String filename)
(19)mapLibraryName(String libname)
(20)nanoTime()
(21)runFinalizersOnExit(boolean value)
(22)runFinalization()
(23)setErr(PrintStream err)
(24)setIn(PrintStream in)
(25)setOut(PrintStream out)
(26)setSecurityManager(SecurityManager s)
(27)setProperties(Properties props)
(28)setProperty(String key, String value ) | |
|
|
|
|