1, data type (Class) object name;
This requires that the data type must be a composite data type, and that the structure of the basic data type declaration is only called a variable, not an object.
Initialization of the object
Object name = new construction Method (parameter);
2. Method:
Access control [modifier] return value type method name (parameter list) {
Method body
}
3. Class:
access control modifier [modifier] class name {
The scope of the property declaration property is the internal public int x = 10 of the class;
[Method declaration]
[Construction Method declaration]
}
The following two points differ mainly in abstract and entity classes:
1. Abstract classes cannot create objects using their own construction methods (syntax not allowed)
2. An abstract class can contain any (0, one or more) abstract methods inside
4, constructs the method: Implements the class this kind of data type the variable initialization.
Access Control constructor Method name (parameter list) {
Construction method body;
}
1.
a method that has a return value. The direct string i= the method name (), and the return value can be taken.
Java notes: Objects, methods, classes