I've come across this piece of code in Java and I thought this wouldn't compile since variables a
and s
are not declared. Not only it compiles but also runs successfully and it prints "5"
. What am I missing here ?
public static void main(String[] args) {
int j=5;
long h = j++, s, a;
System.out.println(h);
}