Object-Basic consolidation and object Consolidation

Source: Internet
Author: User

Object-Basic consolidation and object Consolidation
1. Object Instantiation Process

1) declaration reference

2) use new to create class objects and initialize (allocate memory space)

3) object pointing to the class

Simple Example:

A a = new ();

B B = null;

C c;

2. Understanding of the mean value type and reference type of object type

The memory is divided into two areas: Stack and heap. The stack has a certain storage space and is used to store value types, only the reference addresses (hash codes) of the basic data type and object type can be stored ). The size of data stored in the stack must be within the controllable range of the stack. The values of the basic data types stored in the stack are of the maximum and minimum values, such as int and float; the Heap has a large storage space and is used to store "array type", "string type", and "Object Type" data. The referenced data types stored in the heap are not of a fixed size, variables of the String type can contain 1 or 2 characters... more characters, no matter how much you store, it will open up a space for storing your stored data in the memory heap, and a space for storing the reference address in the stack, when you call it, the compiler will point to the data stored in the memory heap based on the reference address stored in the stack.

 

The basic skills of the basic person are consolidated. If this is not the case, please point it out and change it later.

Related Article

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.