Constructor
It is used in the creation of an object that is an instance of a class
when constructor works
It performs operations operations the class is created
Is the constructor inherited or not
X
Overload
can differentiat the number of parameters, the types of the parameters and the order of the parameter types in Compiler distinguishes between methods with them
How to work JAVA
java file(source file) -> compile -> class file
When several classes in a source file
After compiling, the compiler places both class files for those classes in the same directory
only one public class put in a source-code file
Get and Set Method
| Method | Other Name | Explanation |
|---|---|---|
| Set | mutator method | change an object’s state |
| Get | accessor method query method | control of access from client |
Validation check
Declared private do not allow automatically guaranteed data integrity