I have this code,
class Test
{
public static void main(String args[])
{
int a=--4-2*2/9-3;//Line 1
System.out.println(a);
}
}
Why is this compile time error on --4? Please dont suggest me to have -(-4). I am just trying to figure out, why is above code is a compile time error and if I change the code at line 1 to, a=- -4-2*2/9-3 the O/p is 1. i.e -(-4). For a second I miss took that, it must be same as -= i.e a=a-(rest of the expression). It gives same error with ++ operator too! Can any one explain me this?