0

String is an object or a class ?

i am confused here it is written String is an object and i thought String is a class and its variable name is the object

18th Dec 2016, 4:10 AM
Suprakash Pal
Suprakash Pal - avatar
3 Answers
+ 2
they are be both. you have you object String, wich is an instance of String class. Thats why you can acess to .lenght (for example) property of String class.
18th Dec 2016, 4:14 AM
Nahuel
Nahuel - avatar
+ 2
String someName = "some text" ; String is a class, someName is an object of String class, so you can use all the public methods from String class from your someName variable Like nahuel said someName.lenght()
18th Dec 2016, 6:28 AM
Dago VF
Dago VF - avatar
0
class
18th Dec 2016, 7:37 AM
ASWINI