- /*
- 测试两个函数互相调用是否可行
- */
- public class Demo {
- public static void main(String[] args) {
- method_1();
- }
-
- public static void method_1() {
- System.out.println("method_1");
- method_2();
- }
-
- public static void method_2() {
- System.out.println("method_2");
- method_1();
- }
-
- }
复制代码
打印结果开始时是死循环,跑一会就会出现:
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
at Demo.method_2(Demo.java:18)
at Demo.method_1(Demo.java:13)
|