본문 바로가기
Class/220729

Class(2-3)

by pms93 2022. 7. 31.
package inheritance7;

public class PartTime extends Employee {

	private int time, pay;
	public PartTime() {}
	public PartTime(String name, int time, int pay) {
//		super(name);
		super.setName(name);
		this.time = time;
		this.pay = pay;
	}

	public int getSalary() {
		return this.time * this.pay;
	}
}

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

Class 예제(1)  (0) 2022.07.31
Class(2-4)  (0) 2022.07.31
Class(2-2)  (0) 2022.07.31
Class(2-1)  (0) 2022.07.31
Class(1-5)  (0) 2022.07.31