How to automate the creation of Getter and Setter?
IntelliJ –> Code –> Generate
Constructors
for you to initialize the object that you are creating and do whatever else you wanna do at the time the object is being created.
Constructor Chaining
Encapsulation
What are the benefits of encapsulation?
Reference variable
Class
xxx
Object / Instance
xxx
super keyword
this keyword
Method Overriding
Rules for Java Method Overriding
recursive call
the method would call itself forever until the memory is full
What are the differences between a static method and an instance method?
Static Methods
Instance Methods
How to pass objects as arguments?
code example
public double distance(Point obj) {
int x = obj.getX();
int y = obj.getY();
return Math.sqrt((this.x - x) * (this.x - x) + (this.y - y) * (this.y - y));
}Inheritance
Composition
Polymorphism
What are the four basic concepts of OOP?
getSimpleName()
static field vs. non-static field
static field
non-static field