What is the concept of Class class in java
This article introduces the relevant knowledge of "what is the concept of Class class in java". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Description
Class itself is a class.
Class objects can only be determined by the system.
Only one Class instance in JVM can load a class.
Class corresponds to the .class file loaded in JVM.
The instance of each class remembers which Class example it was generated from.
With Class, you can completely get all the loaded structures in a class.
Class is the root of Reflection. For any class that you want to load and run dynamically, you have to get the corresponding Class object first.
2. Examples
Package com.volcano.reflection; import java.lang.annotation.ElementType; public class TestReflection2 {public static void main (String [] args) {Class a = Object.class;// class Class b = Runnable.class;// interface Class c = String [] .class; / / array, as long as the element type is the same as the dimension, it is a class Class d = int [] [] .class; / / two-dimensional array Class e = Override.class / / Note Class f = ElementType.class;// enumerated type Class g = Integer.class;// basic data type Class h = void.class;//void Class I = Class.class;//Class System.out.println (a); System.out.println (b); System.out.println (c); System.out.println (d); System.out.println (e) System.out.println (f); System.out.println (g); System.out.println (h); System.out.println (I);}} "what is the concept of Class class in java" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!