COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
What is the error in the following code fragment?double[ ] data = new double[20];data[20] = 15.25;
|
A cast is required
|
|
data not initialized
|
|
A two-dimensional array is required
|
|
Out-of-bounds error
|
Explanation:
Detailed explanation-1: -1. What is the error in the following code fragment? double[ ] data = new double[20]; data[20] = 15.25; Answer:-d. Out-of-bounds error Explaination:-Here an array of double called data is declared of size 20 and data[20] = 15.25; is trying to ass…
There is 1 question to complete.