Java.lang.Void Class in Java (original) (raw)
Last Updated : 13 Sep, 2023
Java.lang.Void class is a placeholder that holds a reference to a class object if it represents a void keyword. It is an uninstantiable placeholder. Well, uninstantiable means that this class has a private constructor and no other constructor that we can access from outside.
Methods of lang.void class is all inherited from Object class in Java:
- getClass(): Returns the runtime class of the argument Object.
- hashCode(): Returns a hash code value for the object.
- equals(): Checks whether the two objects are equal or not.
- clone(): Returns a copy of the object.
- toString(): Returns string representation of the object.
- notify(): Wakes up a single thread that is waiting on this object’s monitor.
- notifyAll(): Wakes up all threads that is waiting on this object’s monitor.
- wait(): Makes current thread to wait until previous thread invokes either notify() or notifyAll() methods.
- finalize(): Called By the garbage collector on an object when garbage collection determines that there are no more references to the object.
Reference:
Similar Reads
- java.lang.MethodType Class in Java MethodType is a Class that belongs to java.lang package. This class consists of various types of methods that help in most of cases to find the method type based on the input object, or parameters of the method. All the instances of methodType are immutable. This means the objects of the methodType 4 min read
- Java.lang.Number Class in Java Most of the time, while working with numbers in java, we use primitive data types. But, Java also provides various numeric wrapper sub classes under the abstract class Number present in java.lang package. There are mainly six sub-classes under Number class.These sub-classes define some useful method 9 min read
- Java.Lang.Byte class in Java In Java, Byte class is a wrapper class for the primitive type byte which contains several methods to effectively deal with a byte value like converting it to a string representation, and vice-versa. An object of the Byte class can hold a single byte value. Constructors of Byte Class There are mainly 6 min read
- Java.lang.Package Class in Java In Java, the package class was introduced in JDK 1.2 to encapsulate version data associated with a package. As the number of packages increases, knowing the version of the package has become important. This versioning information is retrieved and made available by the ClassLoader instance that loade 9 min read
- Java.Lang.Double Class in Java Double class is a wrapper class for the primitive type double which contains several methods to effectively deal with a double value like converting it to a string representation, and vice-versa. An object of the Double class can hold a single double value. Double class is a wrapper class for the pr 4 min read
- java.lang.reflect.Method Class in Java java.lang.reflect.Method class provides necessary details about one method on a certain category or interface and provides access for the same. The reflected method could also be a category method or an instance method (including an abstract method). This class allows broadening of conversions to oc 3 min read
- Java.lang.ThreadLocal Class in Java This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. Basically, it is another way to achieve thread safety apart from writing im 4 min read
- Java.lang.Boolean Class in Java Java provides a wrapper class Boolean in java.lang package. The Boolean class wraps a value of the primitive type boolean in an object. An object of type Boolean contains a single field, whose type is boolean. In addition, this class provides useful methods like to convert a boolean to a String and 8 min read
- Java.lang.Class class in Java | Set 1 Java provides a class with name Class in java.lang package. Instances of the class Class represent classes and interfaces in a running Java application. The primitive Java types (boolean, byte, char, short, int, long, float, and double), and the keyword void are also represented as Class objects. It 15+ min read
- java.lang.reflect.Field Class in Java The ability of the software to analyze itself is known as Reflection. This is provided by the java.lang.reflect package and elements in Class .Field serves the same purpose as the whole reflection mechanism, analyze a software component and describe its capabilities dynamically, at run time rather t 5 min read