What is the output of this program?

class Literal8
{
public static void main(String[] args)
{
double d=010.2;
System.out.println(d);
}
}
/*
Output:- 10.2
Explanation:- If we prefix zero(0) before any double number then it is treated as decimal number.
We can specify floating point literal only in decimal form and
we cannot specify in octal and hexadecimal.

*/

0 comments: