One, having a reference does not necessarily require an object to be associated with it, a safe practice is to create a reference and initialize it at the same time.
Second, the object storage of five places: registers, stacks, heaps (a common memory pool), commonsense storage, non-RAM storage.
Basic type
Boolean, Char, Byte, short, int, long, float, double, void
Java provides two classes for high-precision computing
BigInteger supports arbitrary-precision integers
BigDecimal support for arbitrary-precision fixed-point numbers
When an array is created, the value of the array is initialized to null
Third, in C/c++/java, the scope is determined by the position of the curly braces. Java objects do not have the same life cycle as the base type, but cannot access the object after the object's scope is created.
Java has a garbage collection station that can automatically destroy objects that are no longer needed.
Four, basic member default value
When a variable is used as a member of a class, Java ensures that its default value is given.
Booleanfalse
Char NULL
BYTE (byte) 0
Short (short) 0
int 0
Long OL
Float 0.0f
Double 0.0d
If an int x is defined in a method; Then x may be given an arbitrary value, without being initialized to 0,
The basic components of a method in Java include: name, parameter, return value, and method body, methods can only be created as part of a class, methods can only be called by object;
The type and name of each passed object must be specified in the parameter list of the method, where the pass is actually a reference.
Six
To generate names that are not confused with other names for a class library, the Java designer wants programmers to use their own Internet domain names in turn,
This mechanism means that all files will automatically survive in their own namespaces, and each class within the same file has a unique identifier.
Import a package using the import hint compiler, which is a class library. Use * To import all the child packages under the package.
Static means that the field or object is not associated with any object instance of the class that contains it.
There are two ways to refer to static objects or methods, one to locate it through an object, and to invoke it directly from the class name.
Vii. Javadoc is a tool for extracting annotations, the basic syntax:
/** Start/end use of Javadoc in two ways: embedded HTML and "document tags", and standalone document tags are some commands that start with the @ character
There are three types of annotated documents that correspond to the three elements that follow the comment location: class, Domain, method. Also, do not use header tags in embedded HTML, which may conflict with default tags.
Eight, coding style
The first letter of the class name is capitalized, with the first letter of each inner word capitalized.
"Everything is an object"