Advertisements
Advertisements
Question
Identify the correct statement.
Options
double dr = new double;double dr = new double;double dr[] = new dr [5];double dr [] = new double [5];
MCQ
Advertisements
Solution
double dr [] = new double [5];
Explanation:
follows perfect Java syntax for array declaration and instantiation. It explicitly declares a reference variable dr for a double array (double dr[]) and allocates memory for exactly 5 elements using the new keyword followed by the data type and size (new double [5]).
shaalaa.com
Is there an error in this question or solution?
