Java programming Thought--chapter II everything is an object

Source: Internet
Author: User

This chapter does not have much to summarize, if not extended. Some of the previously unnoticed details can be written down.

1. Location of data storage

(1). Register. The program cannot control.

(2). Stack. The reference to the object. Basic type.

(3). Heap. various objects.

(4). Constant storage. and the code together.

(5). Non-RAM storage. Mainly refers to the stream object and the persisted object, the former prepares the network transmission, the latter is thrown on the hard disk.

The array in 2.java is automatically initialized:

(1). Primitive type array elements are initialized to 0

(2). The reference type array element is initialized to null

3. Variable Scope

(1). The basic type is the same as C

(2). When a reference type is scoped, the variable that references the object disappears, and the object itself does not disappear immediately.

4. Member variables are automatically initialized, and local variables do not.

After that, the static methods and variables, namespaces, and some of the annotations are simply not interesting.

Java programming Thought--chapter II everything is an object

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.