
조상 클래스로부터 상속받은 메서드의 내용을 변경하는 것 (change, modify, overwrite)
- 접근 제어자는 조상 클래스의 메서드보다 좁은 범위로 변경할 수 없다.
 
- public > protected > default > private
 - 조상 클래스의 메서드 접근 제어자가 protected라면, 오버라이딩 하는 자손 클래스의 메서드는 protected나 public이어야 함.
 - 조상 클래스의 메서드보다 많은 수의 예외를 선언할 수 없다.
 
class point {
    int x;
    int y;
    
    String getLocation() {
        return "x : " + x + ", y :" + y;
    }
}
class Point3D extends Point {
    int z;
    String getLocation() {      // overriding
        return "x: " + x + ", y: " + y + ", z: " + z;
    }
}
기존에 없는 새로운 메서드를 정의하는 것 (new)
class Parent {
    void parentMethod() {
    }
}
class Child extends Parent {
    void parentMethod() {
    } // overriding
    void parentMethod(int i) {
    } // overloading
    void childMethod() {
    }
    void childMethod(int i) {
    } // overloading
}
Source