Solved

What Is True About the Following Code Snippet

Question 67

Multiple Choice

What is true about the following code snippet?
Public static double[] fillWithRandomNumbers(double[] values)
{
Double[] numbers = new double[values.length];
For (int i = 0; i < numbers.length; i++)
{
Numbers[i] = Math.random() ;
}
Return Arrays.copyOf(numbers, numbers.length) ;
}
Public static void main(String[] args)
{
Double[] num = new double[20];
Num = fillWithRandomNumbers(num) ;
}


A) The code has a run-time error
B) The code has a compilation error
C) The code has a logic error
D) The code is inefficient

Correct Answer:

verifed

Verified

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

Related Questions