Solved

Consider the Following Code Snippet

Question 42

Multiple Choice

Consider the following code snippet:
String[] data = { "abc", "def", "ghi", "jkl" };
Using Java 6 or later, which statement grows the data array to twice its size?


A) data = Arrays.copyOf(data, 2 * data.length) ;
B) data = Arrays.copyOf(data, 2) ;
C) data = Arrays.copyOf(data, 2 * data) ;
D) data = Arrays.copyOf(data, 2 * data.size() ) ;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions