What is the result of the following code execution?

int i1 = 012;
int i2 = 20;
System.out.println(i1 * i2);
Explanation
If a number starts with 0 in java, it is written in octal numeral system (base 8), so 012 = 10 and 20 * 10 = 200

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes