Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top