This is the second time I read the Java book, I feel that the second pass is really a lot of harvest. I recorded some of my own knowledge that I had not noticed before.
1, first the constructor, public Employee (String n,double s)
{Name (instance field) =n (parameter variable);
Salary (instance domain) =s (parametric variable);
The constructor name is the same as the class name and the first letter is capitalized. The first letter of the name of a method is capitalized in the first letter of the second word.
The constructor is able to construct and initialize the object: New Employe () Construction object (employ) staff (variable value) =new Employee (); initialization
2, static variables, static fields, static methods and static classes: static methods and static variables can be accessed directly through the (class. method) without having to construct the object on the row.
Note: Static methods cannot call their non-static methods, non-static domains
3, the accessor (get+ noun), the modifier (set+ noun (Salary)), the accessor is the variable required to access the object, and the change is the line to change the amount of modification.
Some of the basic concepts in Java