in my java code, I get the value of a as 814 and not 5814. why? what is wrong here? I'm using eclipse IDE.
The following code gives:
814
5
14
4
4
public class Hello {
int a = 5814;
int m = (a/1000);
int p = (a %= 1000);
int q = (p %= 100);
int r = (q %= 10);
public Hello() {
System.out.println(a);
System.out.println(m);
System.out.println(p);
System.out.println(q);
System.out.println(r);
}
public static void main(String[] args) {
new Hello();
}
}