day10_CallStackTestEx04

육희영·2021년 10월 5일
0
package day10;

public class CallStackTestEx04 {
	public static void main(String[] args) {
		 System.out.println("main(String[] args)이 시작되었음."); 
         firstMethod(); 
         System.out.println("main(String[] args)이 끝났음."); 
	}
	
	static void firstMethod() { 
        System.out.println("firstMethod()이 시작되었음."); 
        secondMethod(); 
        System.out.println("firstMethod()이 끝났음.");             
	} 

	static void secondMethod() { 
        System.out.println("secondMethod()이 시작되었음."); 
        System.out.println("secondMethod()이 끝났음.");             
	} 
}

출력결과

main(String[] args)이 시작되었음.
firstMethod()이 시작되었음.
secondMethod()이 시작되었음.
secondMethod()이 끝났음.
firstMethod()이 끝났음.
main(String[] args)이 끝났음.

0개의 댓글

관련 채용 정보