Which statement is true about the code snippet below? ArrayList<String> names = new ArrayList<String>() ;
Names.add("John") ;
Names.add("Jerry") ;
ArrayList<String> friends = new ArrayList<String>(names) ;
Names.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
Q93: Which one of the following is the
Q94: Which statement is true about the code
Q95: How many elements can be stored in
Q96: Which one of the following statements is
Q99: What is the output of the code
Q100: Consider the following code snippet: public static
Q101: Assume the method createSomething has been defined
Q102: Assume the array of integers values has
Q106: What should you check for when calculating
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