Which statement is true about the code snippet below? ArrayList<String> names = new ArrayList<String>() ;
Names.add("John") ;
Names.add("Jerry") ;
ArrayList<String> friends = names;
Friends.add("Harry") ;
A) The final size of names is 2; the final size of friends is 3
B) The final size of names is 3; the final size of friends is 2
C) The final size of names is 3; the final size of friends is 3
D) Compilation error
Correct Answer:
Verified
Q39: Assume the variable numbers has been declared
Q89: Assume the following variable has been declared
Q90: What is the output of the following
Q93: Which one of the following is the
Q95: How many elements can be stored in
Q96: Which one of the following statements is
Q97: Which statement is true about the code
Q99: What is the output of the code
Q106: What should you check for when calculating
Q110: When an integer literal is added to
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