Contents
Class Void in Java
The Void class may not be instantiated, and serves merely as a placeholder for its static TYPE field, which is a Class object constant that represents the void type.
The Void class is an uninstantiable wrapper for the primitive type void. The class contains simply a reference to the Class object that represents the primitive type void.
The structure of the class Void is given by
public final class java.lang.Void extends java.lang.Object {
// No Constructor
// Constants
public static final Class TYPE;
}
The details of the Void class is given as:
public static final Class TYPE;
public static final Class TYPE represents the Class object that represents the primitive type void. It is always true that Void.TYPE == void.class.
Apart from these Void class also has inherited methods from class- Object. They are as follows:
- clone()
- finalize()
- hashCode()
- notifyAll()
- wait()
- wait(long, int)
- equals(Object)
- getClass()
- notify()
- toString()
- wait(long)