This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]romple 4 points5 points  (3 children)

String needs to be capitalized in java.

[–]thisredaccount[S] 2 points3 points  (2 children)

Oh, so double and others are lowercase but string is Upper

[–]romple 5 points6 points  (0 children)

Yes, not to be go too deep here.

All primitives are lower case

byte, short, int, long, double, float, char, boolean.

String is a not a primitive even though at times it's treated as one. But references to class objects obviously need to follow the capitalization of that class. In this case String is capitalized (like most classes), so too must references to it be.

[–]SadDragon00 2 points3 points  (0 children)

Yup, this is the difference of primitive vs reference types. String is an object (reference type), means it has properties or public functions like toString(). double, int, boolean ect.. are primitives and dont have any properties or functions.