filmov
tv
Java Practice-it Introduction to Java Programming | Self-Check 1.28 Confusing3

Показать описание
Topics:
classes, method basics, mystery, println
Question:
What is the output produced from the following program? You may wish to draw a structure diagram first. This is a slightly modified version of the previous problem, Confusing2.
public class Confusing {
public static void main(String[] args) {
method2();
method1();
method3();
method2();
}
public static void method2() {
method1();
}
public static void method3() {
method2();
method1();
}
public static void method1() {
}
}
Problem:
classes, method basics, mystery, println
Question:
What is the output produced from the following program? You may wish to draw a structure diagram first. This is a slightly modified version of the previous problem, Confusing2.
public class Confusing {
public static void main(String[] args) {
method2();
method1();
method3();
method2();
}
public static void method2() {
method1();
}
public static void method3() {
method2();
method1();
}
public static void method1() {
}
}
Problem: