doublemetal 2013. 7. 9. 12:55


/*static method로 구현했기 때문에 

 * 객체가 할당되지 않아도(기본적인 객체가 자동할당됨) 메소드를 사용할 수 있다.

 * min -> first -> second 순서로 호출

 * 스택이기 때문에 종료는 반대로 진행됨

*/

public class CallStack {


public static void main(String[] args) {

// TODO Auto-generated method stub

System.out.println("1 start");

firstMethod();

System.out.println("1 end");

}


static void firstMethod() {

// TODO Auto-generated method stub

System.out.println("2 start");

SecondMethod();

System.out.println("2 end");

}


static void SecondMethod() {

// TODO Auto-generated method stub

System.out.println("3 start");

System.out.println("3 end");

}

}