हिंदी

Identify the correct statement. (a) double dr = new double; (b) double dr = new double; (c) double dr[] = new dr [5]; (d) double dr [] = new double [5];

Advertisements
Advertisements

प्रश्न

Identify the correct statement.

विकल्प

  • double dr = new double;

  • double dr = new double;

  • double dr[] = new dr [5];

  • double dr [] = new double [5];

MCQ
Advertisements

उत्तर

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Class as the Basis of all Computation - Exercises [पृष्ठ ६४]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 2 Class as the Basis of all Computation
Exercises | Q 1. (v) | पृष्ठ ६४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×