0
why the answer is 15??
class jkl { public static void main(String[] args) { int a=07; int b=010; System.out.println(a+b); } }
1 Answer
+ 4
In Java integer numbers with a leading zero are interpreted as octal based numbers.
07 equals 7 in the decimal system
010 equals 8 in the decimal system
7+8 = 15