Advertisements
Advertisements
प्रश्न
Which of the following is an invalid statement?
विकल्प
A class is a composite data type
Statement import is used for including a package
Primitives have fixed size
String is a primitive
MCQ
Advertisements
उत्तर
String is a primitive
Explanation:
This statement is invalid because String is a non-primitive (reference) data type in Java. Unlike primitive types (like int, char, or double) which hold raw values directly in fixed memory slots, a String is an object instantiated from a full class in the java.lang package designed to hold and manipulate character sequences.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 5: Library Classes - Exercises [पृष्ठ १३३]
