- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersonTest.java
More file actions
Latest commit
19 lines (15 loc) · 782 Bytes
/
Copy pathPersonTest.java
File metadata and controls
19 lines (15 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
packageweek02.basic;
publicclassPersonTest {
publicstaticvoidmain(String[] args) {
System.out.println("<자기소개 메서드>");
// 3단계(기초): 자기소개 메서드
// 문제: Person.java에 이름(name) 멤버 변수를 만드세요. "제 이름은 [name]입니다." 라고
// 출력하는 introduce() 메서드를 구현하고, PersonTest.java에서 객체를 생성하여
// 이름 값을 할당한 뒤 메서드를 호출하세요.
// 핵심 사고: 클래스 내에서 특정 기능을 수행하는 단위인 메서드를 정의하고 호출하는 방법을 익힙니다.
// 힌트: 클래스, 멤버 변수, 메서드 정의, 객체.메서드(), 객체화
Personp = newPerson();
p.name = "김혜빈";
p.introduce();
}
}