Running a Java program in a Web page is called an applet.
Reflection
This feature is used extensively in JavaBeans, which is the architecture of Java components.
A program capable of analyzing classes is called reflection (reflective). The function of the reflection mechanism and its powerful, as can be seen below, the reflection mechanism can be used to:
- Ability to analyze classes in the run
- View objects in the run, for example, write a tostring method for use by all classes.
- Implementing the array manipulation code through
- Using Method objects
The main user of reflection is the tool constructor.
class, during a program run, the Java Runtime system always does not have all objects maintained by a chant called Runtime type identity. This information tracks the classes that each object belongs to. The virtual machine uses the run-time type information to select the appropriate method to execute.
The class that holds this information is called the GetClass () method in the Class,object class and returns an instance of class type.
GetName (): Get class Name
Forname (): Gets the class object that corresponds to the category name
Newinstance (): Quickly create an instance of a class.
"Reading notes" Java Core technology-the basics-reflection