Class/220729
Class(2-1)
by pms93
2022. 7. 31.
package inheritance7;
import java.util.ArrayList;
public class PermanentMain {
public static void main(String[] args) {
ArrayList<Employee> emp = new ArrayList<>();
emp.add(new Permanent("김변수", 3000000));
emp.add(new Permanent("이상수", 4000000));
emp.add(new Permanent("박참조", 5000000));
emp.add(new PartTime("김파트", 160, 9500));
emp.add(new PartTime("이파트", 160, 10000));
emp.add(new PartTime("김파트", 160, 15000));
for (Employee emps : emp) {
System.out.println("이름 : " + emps.getName());
System.out.println("급여 : " + emps.getSalary() + "원");
System.out.println();
}
}
}