"DAY23" JVM with reflective learning notes

Source: Internet
Author: User

Jvm:

-----------------

1.jvm:java virtual machine.

2.class file

*.class

3.ClassLoader

4.runtime Data area

The run-time data area.

1.Method Area: Method zone. (shared)

Shared for all threads.

2.heap (Shared):

Shared for all threads.

3.java stack (stack area)

Exclusive.

4.native method Stack (local methods stack)

Exclusive

5.Program Counter Register

Program counter.

5.execute engine

Execution engine.

6.native interface

Local interface

7.native Libraries

Local class Library

Jvisualvm

--------------

1. Using the JVISUALVM tool that comes with the JDK

${java_home}/bin/jvisualvm.exe software.

2. Writing procedures

Class.forName ("xx.xx.xxx.Xxxx");

Class.forName ("Xx.xx.xxx.Xxxx", False,xxx.class.getclassloader ());

Java Reflection

--------------

Dynamically accesses the properties and methods of an object.

1.java.lang.reflect

2.java.lang.class: Class class, Class descriptor, describes the appearance.

3.java.lang.reflect.method

A method descriptor that describes the characteristics of a method.

4.java.lang.reflect.field

field that describes the characteristics of the field.

5.java.lang.reflect.constructor

Constructors

6.java.lang.reflect.modifier

Modifier.

Class Cat{private string color;p rivate string name;//...get/setxxxprivate Cat (String color,string name) {//this.xxx ...} public void Catchmouse () {System.out.println ("xxxx");}}

1. Create a Cat object by reflection mode.

2. The reflection method calls the Catchmouse () method.

3. The reflection mode is assigned a value of name and color.




"DAY23" JVM with reflective learning notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.