What is the output of this program?

class Literal1
{
public static void main(String[] args)
{
int i=012;
System.out.println(i);
}
}
/*
Output:- 10
Explanation:- A decimal number prefixed with zero(0) is called octal literal. If we print
any literal value that will print in decimal format.
*/

0 comments: