Special mind Points of knowledge

Source: Internet
Author: User

(i) Memory allocation:

Stack data structure: Used to hold local variable values, including:
① basic data types;
② reference data type;
It should be noted that:
The base data type is stored in the stack as the actual value of the variable,
The reference data type holds the first address it points to to hold the value in heap memory.

2. Heap: Used to store dynamically generated data example: New object, heap only save properties, not save method;

3. Constant pool: An ordered collection of constants used to maintain each class.
The constants in the heap and stack are also stored in the corresponding location of their values or reference addresses;

4. When the reference type is compared with "= =", the reference address is compared.

(ii) identifiers

1. Definition: The so-called identifier is the user-defined class name in Java, the method name,
Field name, variable name, package name, and so on.

2. Identifiers Define rules:

The ① identifier cannot be a keyword or a reserved word;

② identifiers can contain letters, numbers, underscores, dollar sign $;

The beginning of the ③ identifier cannot be a number;

④ identifiers are strictly case-sensitive, but do not specify the maximum length of identifiers;

3. Common naming methods:

① Hump nomenclature: All initial letters are capitalized as: class name;

② Pascal nomenclature: First lowercase, other first letters capitalized. such as variable name, method name;

(c) polymorphic

1. Classification:
① static polymorphism: The way of implementation is the overloading of the method;
② Dynamic polymorphism: The way to implement is to rewrite the parent class;
Note: We are talking about polymorphism, which is generally referred to as dynamic polymorphism.

2. Transformation of reference data (the same syntax as the basic Data Transformation):
① upward Transformation: from sub-class to the parent class, can be automatically implemented;
② downward transformation: From the parent class to the sub-class, need to cast;
3. Instantof Keywords:
An instance of the object that is used to determine whether the object before Instantof is Instantof. (Is return true, not return false)

Special mind Points of knowledge

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.