Given two files:
1. package com; 2. public class MyClass { 3. public static void howdy() { System.out.print("howdy "); } 4. public static final int myConstant = 343; 5. public static final MyClass mc = new MyClass(); 6. public int instVar = 42; 7. } /*from w w w. ja v a 2 s . c om*/ 11. import com.MyClass; 12. public class Main { 13. public static void main(String[] args) { 14. MyClass.howdy(); 15. System.out.print(MyClass.myConstant + " "); 16. System.out.print(myConstant + " "); 17. howdy(); 18. System.out.print(mc.instVar + " "); 19. System.out.print(instVar + " "); 20. } }
What is the result? (Choose all that apply.)
D, E, F, and G are correct.
Lines 16, 17, 18, and 19 are incorrect ways to access the elements of MyClass in package com.
A is incorrect because the code does not compile.
B and C are incorrect because those lines access the elements correctly.