Java-Preliminary Understanding-sixth-Reference data type parameter pass plot

Source: Internet
Author: User

One.

The subject is related to the object, and is the demo class in the creation of the demo object, this kind of object?

Although the beginning of the subject is an int x=3, which defines the member variables in the class, the JVM still enters the program from the main function first.

First load the main function into the stack memory main and local variable d. (after entering from the Mian main function as a portal, execute the demo d=new demo () and then int x=3.) It then opens up a demo class type space in the heap memory. The object created here is the same as the class name, which naturally introduces the attribute, the member variable x. Here is four step walk, open space, assign address, default initialization, variable assignment. Another thing to note is that the demo d = new Demo () is a three-step sequence, first running the left demo D, then the right new demo (), and finally the two links together.

Java-Preliminary Understanding-sixth-Reference data type parameter pass plot

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.