In all the editors I have tried variable declarations usually have color highlighting. int, char, double, etc.. are all colored. Except Strings. Does it have to do something the concept of a String? That is is not considered similar to other variable-types?
String randString = "A random String";
Here it is actually colored.
I am talking about Intellij, VIM, Sublime Text for example..
First of all, String
completely differs from int
, char
and double
cause it's a class while these are primitives.
Second, you should read the specification of each specific editor or IDE to learn about it's conventions, for example Eclipse .
Because , only reserved keywords are coloured in every IDE to make sense that programmer cannot assign these names to any variables of method or any other user-defined members. and String is not a reserved word, it is a class in Java API , so it is not coloured.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.