본문 바로가기
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();
		}

	}
}

'Class > 220729' 카테고리의 다른 글

Class(2-3)  (0) 2022.07.31
Class(2-2)  (0) 2022.07.31
Class(1-5)  (0) 2022.07.31
Class(1-4)  (0) 2022.07.31
Class(1-3)  (0) 2022.07.31