String is a sequence of characters, But in Java, string is an Object

Q.  Generally string is a sequence of characters, But in java, string is an _______.
- Published on 13 Jul 15

a. Object
b. Class
c. Package
d. None of the above

ANSWER: Object
 

    Discussion

  • Rupesh Bharuka   -Posted on 29 Sep 16
    Yeah, it is true that in Java everything is in the form of String. But as questions asks, In Java String is a Class type.

    String is not just a class rather it is a 'final' class in java presents in java.lang package which is by default imported in all java programs.
  • V   -Posted on 08 Mar 16
    Option (a). Since in java all literals & inputs given by the user is accepted only in the form of Strings. A string in java considers integers, boolean, charatcers all as string

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)