Which are true of the following code? (Choose all that apply)
1: public class Main { 2: public static void swing() { 3: System.out.print("swing "); 4: } 5: public void climb() { 6: System.out.println("climb "); 7: } 8: public static void play() { 9: swing(); 10: climb(); 11: } 12: public static void main(String[] args) { 13: Main m = new Main(); 14: m.play(); 15: Main m2 = null; 16: m2.play(); 17: } 18: }
B
Line 10 does not compile because static methods are not allowed to call instance methods.