Everything is Object thinking in Java Chapter II

Source: Internet
Author: User

2.1 manipulating objects with references

1. Objects and references can be used to manipulate objects by reference;

2. The reference may also exist separately, that is, there is no connection with any object, and the reference operation without connection with the object will be error-free;

2.2 All objects must be created by you

1. Where to store

Register

Stacks:* fast storage destruction, basic types of storage places

Heap:* constant pool; where the generic object is stored

Constant storage

Non-RAM

2. Exceptions: Basic types

stored in the stack, this variable directly stores the value, so more efficient;

High precision number: biginteger,bigdecimal;

2.3 never have to destroy objects

Garbage collection mechanism

2.4 Creating a new data type: Class

New

Basic type default value: as follows

false char : ' \uoooo ' (null)  byte : (byte) o   short: (Short  ) o  int  : o  long  : OL  float  : o.of 
   
    double : O.od  
   

2.5 methods, parameters, and return values

2.6 Building a Java program

    *static keyword: the static element has only one memory space , so it is basically no contact with the object, only through the object name can be accessed, do not need to have a specific implementation object;

    *Final keyword: Indicates that it cannot be modified, that is, after determining the value of the final element in his defined field, but not in its field (such as two objects of different implementations), the final element can be different;

    *static FIANL element: That is, unique and immutable

2.7 Your first Java program

2.8 Annotations and embedded documents

2.9 Coding Style

Everything is Object thinking in Java Chapter II

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.