What is the output of this program?

class Literal9
{
public static void main(String[] args)
{
double d=0x10.2;
System.out.println(d);
}
}
/*
Output:- Compilation Error
Explanation:- If we prefix "0x" before any double number then it is treated as wrong number and
generates compilation error. We can specify floating point literal only in decimal form
and we cannot specify in octal and hexadecimal.

*/

0 comments: