Java programming ideas - everything is an object Chapter II

Everything is an object

2.1 with the manipulation object reference

In fact, the object reference is a type of variable

2.2 You must create all the objects

This section explains the new keyword to create an object with the object stored on the heap, then probably explain the basic types and packaging, automatic unpacking boxes, as well as high-precision digital, biginteger and bigdecimal, with more general bigdecimal . Finally, he said about Java access to the range of the array are now, to ensure the safety of the procedure, followed by an array of special chapters explain.

2.3 Never destroy the object

Because Java has garbage collection mechanism so that the destruction of the basic need of managed objects, then referred to the scope of general scope range of variables within it are in braces, and the scope of the object does not have this limitation, the object in the trash detected not automatically recovered after destruction by reference.

2.4-2.7 classes and methods

These sections are relatively simple, understand basic written in Java.

2.8 Notes and embedded documents

This section is also simple, but I want to say, annotate really, really important, anyway, I took someone else's code, no comment I am very reluctant to see, so we must pay attention to the comment, then people can at least make a good impression , but also to facilitate their viewing.

Guess you like

Origin www.cnblogs.com/chunyun/p/11839641.html