개요

서브클래스에서만 사용하는 필드를 내린다.

예시


class Employee{
    protected String name;
}
class Salesperson extends Employee{
}
class Engineer extends Employee{
}


class Employee{
}
class Salesperson extends Employee{
}
class Engineer extends Employee{
    private String name;
}

 

+ Recent posts