+ 3

Is java a space sensitive programming language?

Sometimes during tutorials I observe that there is inconsistency in spacing for statements. For example, sometimes it's written as int x=0; while for the rest it's written as int x = 0; . Does the spacing matter?

25th Nov 2017, 6:42 AM
Zhang Zhenjie
Zhang Zhenjie - avatar
3 Respuestas
+ 5
No! it's optional
25th Nov 2017, 6:46 AM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 3
Follow the language code conventions, if you want your code to be read by real programmers.
25th Nov 2017, 7:21 AM
Boris Batinkov
Boris Batinkov - avatar
+ 1
Usually you use a code formatter which formats the code according to the code conventions. So you do need to care about adding white space or not.
25th Nov 2017, 8:20 AM
Weazel