인사하기
프로그램이 main() 부분에 도달할 때마다 사용자에게 좋은 하루를 기원하는 인사를 하도록 하고 싶어요.
이 연습은 강의의 일부입니다
중급 Java
연습 안내
- 사용자 정의 메서드 앞에
static키워드를 넣으세요. main()내부에서 사용자 정의 메서드genericGreeter()를 호출하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
class Greeter {
// Enter the keyword to be able to access it in main
____ void genericGreeter() {
System.out.println("Nice day to you !");
}
public static void main(String[] args) {
// Call the above function to have the program greet you
____();
}
}