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