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) ;
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
Q81: What is the output of the following
Q82: 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
Q87: Consider the following code snippet, where the
Q88: Which statement is true about the code
Q89: Assume the following variable has been declared
Q90: What is the output of the following
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