ArrayList Worksheet 1

By Mickey Arnold
Last updated 10 months ago
14 Questions
Do not put this in eclipse. It is not for a grade, so see if you get what is happening.

What is the output of System.out.println(sam.get(0)); // LINE 1?

What is the output of System.out.println(sam.get(2)); // LINE 2?

What is the output of System.out.println(sam.set(1, "up")); // LINE 3?

What is the output of System.out.println(sam.indexOf("ben")); // LINE 4?

What is the output of System.out.println(sam.contains("sam")); // LINE 5?

What is the output of System.out.println(sam); // LINE 6?

What is the output of System.out.println(sam); // LINE 7?

What is the output of System.out.println(sam); // LINE 8?

What is the output of System.out.println(sam); // LINE 9?

What is the output of System.out.println(sam); // LINE 10?

What is the output of System.out.println(sam); // LINE 11?

What is the output of the for loop at LINE 12?

What is the output of System.out.println(sam); // LINE 13?

What is the output of System.out.println(sam); // LINE 14?