This class is used to bind together the supplied class and class file bytes in a single ClassDefinition object. These class provide methods to extract information about the type of class and class file bytes of an object. This class is a subclass of java.lang.Object class.
public final class ClassDefinition extends Object
Constructor Description ClassDefinition(Class<?> theClass, byte theClassFile) This constructor creates a new instance of ClassDefinition class by binding the supplied class and class file bytes.
Method Description getDefinitionClass() This method is used to get the class type of this class getDefinitionClassFile() This method Is used to get the array of bytes that contains the new class file.
Example 1: Java program to create new ClassDefinition object
ClassDefinition object successfully created
Example 2: Java program to illustrate ClassDefinition class methods
class GFG$demoClass [B@448139f0
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.