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 [पृष्ठ १३३]
