[접근제한자] class 클래스명 extends 클래스명 {}
public class Academy extends Company {}
ㄴ 자식 ㄴ 부모
// Academy 클래스에 Company 클래스 내용을 확장/연장한다
// == Academy 클래스에 Company 클래스의 필드, 메서드를 추가하여 확정한다

1. 모든 클래스는 Object 클래스의 후손
2. 부모클래스의 생성자, 초기화 블록은 상속 안 됨
3. 부모의 private멤버는 상속은 되지만 직접접근 불가
// 상속 방법 : 자식 extends 부모
public class Student extends Person {
// Student 클래스에 Person 클래스 내용을 확장/연장 한다
// == Student 클래스에 Person 클래스의 필드, 메서드를 추가하여 확정한다
// 속성(필드)
// Person 클래스와 겹치는 부분은 필요없어 지게 됨
/* private String name; // 이름
private int age; // 나이
private String nationality; // 국적
*/ private int grade; // 학년
private int classRoom; // 반
public Student() {}
public Student(String name, int age, String nationality, int grade, int classRoom) {
//this.name = name;
//this.age = age;
//this.nationality = nationality;
// 왜 안될까?
// -> this 참조변수는 본인 자신만을 의미함 (Student만)
// -> 상속을 받았어도 name, age, nationality는
// 부모의 고유 필드이기 때문에
// 자식인 Student에서 this 참조변수를 이용해 직접접근 불가
/* setName(name);
setAge(age);
setNationality(nationality);
*/ // 부모의 setter를 이용을 할 수는 있지만 비효율적
// super(); : 부모의 기본생성자
// super(매개변수...); : 부모의 매개변수생성자
super(name, age, nationality); // Person의 매개변수생성자 의미
this.grade = grade;
this.classRoom = classRoom;
// 부모의 고유필드는 super로, 자식의 고유필드는 this로
}

해당 메서드가 오버라이딩 되었음을 컴파일러에게 알려주는 역할
부모 클래스의 메소드와 자식 클래스의 메소드 비교

상속불가 (누군가의 부모가 될 수 없다)
제공되는 클래스 그대로 사용해야 하는 경우 ex) String 클래스
상속이 불가능한 클래스
public final class finalClass {}
public final class Employee extends Person {}
오버라이딩 불가 - 메서드의 기능이 변하면 안되는 경우
상속 시 오버라이딩이 불가능한 메소드
public final void onlyEmployee() {}
final 메서드 오버라이딩 불가 확인
@Override
public void onlyEmployee() {
// Cannot override the final method from Employee