This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Which statements are true? (Choose all that apply.) A. The output is 0. B. The output is 5. C. The output is 6. D. Compilation fails. E. The code compiles if line 1 is removed. F. The code compiles if line 2 is changed to read Useful uuu = new Useful();
Answer: 3 D is correct. The increment() method must be marked public to be accessed outside of the package. If increment() was public, C, E, and F would be correct.
I find, this pretty clear.. Note that there's a mention "in different files" and there's no package statement in the second class.. So it belongs to the default package.. not to the xcom package..