Using the new Keyword Java provides the new keyword to instantiate a class. We can also instantiate the above class as follows if we defining a reference variable. We observe that when we use the new keyword followed by the class name, it creates an instance or object of that class.
Read moreWhat is class forName () does and how it is useful?
forName. Returns the Class object associated with the class or interface with the given string name, using the given class loader . Given the fully qualified name for a class or interface (in the same format returned by getName ) this method attempts to locate, load, and link the class or interface.
Read moreWhat does the class forName my class do?
Class. forName() instructs the Classclass to find a class-loader and load that particular Class object into the memory used by the JVM .
Read moreWhat is the reflection in Java?
Reflection is a feature in the Java programming language. It allows an executing Java program to examine or “introspect” upon itself, and manipulate internal properties of the program . For example, it’s possible for a Java class to obtain the names of all its members and display them.
Read more