What is the output of the following statements? ArrayList<String> names = new ArrayList<String>() ;
Names.add("Bob") ;
Names.add(0, "Ann") ;
Names.remove(1) ;
Names.add("Cal") ;
Names.set(1, "Tony") ;
For (String s : names)
{
System.out.print(s + ", ") ;
}
A) Cal, Bob, Ann
B) Ann, Bob
C) Ann, Tony
D) Cal, Bob, Tony
Correct Answer:
Verified
Q77: Which one of the following is the
Q79: Consider the following code snippet:
Int val =
Q80: What is the output of the following
Q81: What is the output of the following
Q83: What is the output of the code
Q84: Consider the following code snippet:
Int[][] arr =
{
{
Q85: What is the output of the following
Q86: Which statement is true about the code
Q87: Consider the following code snippet, where the
Q100: Which one of the following is a
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents