+ 1

Shouldn't "String" start with lower letter like "string"?

7th Nov 2018, 7:56 AM
Аслан Борчашвили
Аслан Борчашвили - avatar
2 Answers
+ 15
In Java, strings are objects. As with other objects, you can create an instance of a string with the new keyword, as follows: String s = new String(); This line of code creates a new object of class String and assigns it to the reference variable s.
7th Nov 2018, 10:19 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 5
Beacuse String is a class name it is case sensitive.
7th Nov 2018, 9:05 AM
D_Stark
D_Stark - avatar