java-initialization Process

Source: Internet
Author: User

java-Initialization Process
the initialization process of an object
1,JVM loading the class memory
2, the static code block executes (without skipping it) and initializes the class
3, open up heap memory space, allocate memory address
4, the private member variable is initialized by default first,
5, the object is displayed for initialization
6, and then construct the code block initialization (skip if not)
7, constructor initialization
8, assign the memory address to the P (object) variable in the stack memory

Two object invocation members

1, object in heap memory
2, class variable in stack memory
3, method and static data in data area
Process:
When a class variable calls a method of a data region, the heap memory address is assigned to the class variable, the this pointer.

Copyright NOTICE: Welcome to Exchange, QQ872785786

java-initialization Process

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.