Given:
1. import java.util.*; 2. public class Main implements Command { 3. public static void main(String[] args) { 4. List<String> x = new ArrayList<String>(); 5. x.add("3"); x.add("7"); x.add("5"); 6. List<String> y = new Main().doStuff(x); 7. y.add("1"); 8. System.out.println(x); /*from ww w . java2s . com*/ 9. } 10. List<String> doStuff(List<String> z) { 11. z.add("9"); 12. return z; 13. } 14. } 15. interface Command { 16. List<String> doStuff(List<String> s); 17. }
What is the most likely result?
D is correct.
Main.doStuff()
must be marked public.
If it is, then C would be correct.