Here are the main classes in java.lang package.
- classses
- Boolean
- Byte
- Character
- Character.Subset
- Character.UnicodeBlock
- Class<T>
- ClassLoader
- Compiler
- Double
- Enum<E extends Enum<E>>
- Float
- InheritableThreadLocal<T>
- Integer
- Long
- Math
- Number
- Object
- Package
- Process
- ProcessBuilder
- Runtime
- RuntimePermission
- SecurityManager
- Short
- StackTraceElement
- StrictMath
- String
- StringBuffer
- StringBuilder
- System
- Thread
- ThreadGroup
- ThreadLocal<T>
- Throwable
- Void
- Interfaces
- Appendable
- CharSequence
- Cloneable
- Comparable<T>
- Iteratable<T>
- Readable
- Runnable
- Thread.UncaughtExceptionHandler
First we take a look at the most important class Object class. Object class has several methods. Some methods are very useful. Here are the methods in Object class.
- protected Object clone()
- boolean equals(Object obj)
- protected void finalize()
- Class<?> getClass()
- int hashCode()
- void notify()
- void notifyAll()
- String toString()
- void wait()
- void wait(long timeout)
- void wait(long timeout, int nanos)
Now We take a look at some examples of these methods.
- protected void finalize() throws Throwable
- Called by garbage collector. (System.gc)
- We can override this method to cleanup some resources
- Not invoked more than once by a virtual machine for given object.
Great Article
ReplyDeleteOnline Java Training | Java EE course | Java Course in Chennai | Java Training in Chennai | Java Training Institutes in Chennai | J2EE Training in Chennai | java j2ee training institutes in chennai