I am writing some code and i need to elaborate a class to build zip codes. My zip code in portugal ends with XXXX-032 and i inserted 032 into the 'int' parameter and java reads 032 as 26. Why does this happen?
For now instead of 032 i am using only 32 to be easier.
public CodigoPostal(int fourDigits, int threeDigits) {
this.parcela1 = fourDigits;
this.parcela2 = threeDigits;
}
CodigoPostal code1 = new CodigoPostal(3421, 32);
System.out.println(code1);
System.out.println(code1.getThreeDigits());
I expected the first sout to be 3421-032 and the second 032 but the acutal is 3421-026 and 26. Why does java understand 032 as 26?