ArrayList Worksheet 1

Last updated over 1 year ago
14 questions
Do not put this in eclipse. It is not for a grade, so see if you get what is happening.
1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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

1

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