ManClass.java
package com.javalec.makeClass;
public class ManClass {
private int age;
private int height;
private int weight;
private String phoneNum;
public ManClass(int age, int height, int weight, String phoneNum) {
// TODO Auto-generated constructor stub
this.age = age;
this.height = height;
this.weight = weight;
this.phoneNum = phoneNum;
}
// 여기서 마우스 오른쪽 -> Source -> Generate Getters and setters -> Select All 눌러주면 됩니다
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
public String getPhoneNum() {
return phoneNum;
}
public void setPhoneNum(String phoneNum) {
this.phoneNum = phoneNum;
}
}
'JAVA > Java 기초' 카테고리의 다른 글
19. 학사 관리 프로그램 (0) | 2020.03.31 |
---|---|
17.클래스 만들기 (0) | 2020.03.30 |
16. 사용자로부터 1에서 9까지 숫자 중 한개의 숫자를 입력받아 구구단 출력 (0) | 2020.03.13 |
15. 절차지향 , 객체지향 (0) | 2020.03.13 |
14. 학생들의 평균 신장 가장 큰 학생 가장 작은 학생 (0) | 2020.03.12 |
댓글