can anyone explain me the output of the following program :
Thanks in advance
// program
Thanks in advance
// program
Code:
class No_System_Demo
{
public static void main(String[] n)
{
double d=020; // octal no 20 stored
System.out.println("d=" +d); // output will be in decimal number system and is 16.0 and thats fine
double d1=020.0; // octal no's can have a decimal so the same no 20 or say 20.0 is stored
System.out.println("d1=" +d1); // but this time why the output isn't in decimal number system, it displays 20.0 instead of 16.0
}
}