Advertisements
Advertisements
प्रश्न
Identify the true statement.
विकल्प
In an array, all elements have same data type.
In a class, all members have same data type.
In an array, all elements have different data type.
In a class, all members have same value.
MCQ
Advertisements
उत्तर
In an array, all elements have same data type.
Explanation:
- An array is a collection of elements of the same data type stored in consecutive memory locations. It is used to store multiple values under a single variable name.
- Since all elements belong to the same type, the compiler knows how much memory to allocate for each element.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Class as the Basis of all Computation - Exercises [पृष्ठ ६४]
