Class One: The purpose of creating a new data type by encapsulating other data types. You can include basic data types and non-basic data types inside a class
1. The source code of the Java language is stored in the file as a unit of the class.
2. There are two formal names in the body of a class: attributes and member variables .
3. Create a reference to a class (declaring a variable of a class): class name + space + class variable name
4. Create an object of a class (an entity that creates a class): new + space + class name + (). In the Create entity procedure, let the variable of the class declared in 3 point to the Entity.
5. Because the reference created refers to the entity of the class, the variable represents the object of the class. When you use a property in a class, you can directly use the reference (variable) you create to point to the object of the class.
The format is: the variable name of the class + "." + property name
second, object: New creates the object of the class
1, when using the object, is through the Object's reference, to manipulate the Object's Entity.
2. An object can be pointed to by multiple references
3. If an object does not point to any of the references, the object will no longer exist.
Iii. relationships between classes, objects, and references
1, the data type of the entire composition of the new data Type--class
2. Entities that create data based on the definition of a class-object
3. Variables created through the Class--reference
4, reference to the object, is created through the class, is the bearer of classes and objects in the middle of a bridge.
Iv. syntax for using object attention
1, the reference can not point to any object.
2, If the reference does not point to any object, by reference to manipulate the object will cause a null pointer exception Problem. NullPointerException
Java Basics (ii)-classes, Objects