I was just experimenting with variable names when I realized this:-
int n; //this is a valid name
int .n; //this is a invalid name
int ..n; //this is a invalid name
int ...n; //this is a valid name
I was just experimenting with variable names when I realized this:-
int n; //this is a valid name
int .n; //this is a invalid name
int ..n; //this is a invalid name
int ...n; //this is a valid name
The special token ...
is to declare var-args parameters in method signatures, as in
void foo(String... bars){}
So in your example, it gets parsed differently (as int... n
), and is not considered part of the variable name.
But it is still invalid syntax, comparable to int +n;
or int (n;
, because the token does not make sense here.