+ 3
y is it a valid declaration in java: int f=1_0;
I found a question in challenge which asked me to select all valid declarations in Java. I didn't select 'int f=1_0;' n hence I got the answer wrong. When I checked the answer, int f=1_0; was also chosen n my oppent had also chosen it.
2 odpowiedzi
+ 2
thankya
+ 1
The _ is a digit separator in Java, just as , is in natural language outside Europe at least, where they use . instead of ,. It was introduced in Java 7 if I recall correctly. so, in the question, f=10.