0
我们如何在Java中编写浮点数的二进制,八进制和十六进制文字?无论是科学还是正常的表现。我们如何在Java中编写浮点数的二进制,八进制和十六进制文字?
class First
{
public static void main(String[] args)
{
double b = 0x12p3;
System.out.println(b);
}
}
上述程序导致144.0
class First
{
public static void main(String[] args)
{
double b = 0x12e3;
System.out.println(b);
}
}
上述程序导致4835.0
class First
{
public static void main(String[] args)
{
double b = 0x12e3;
System.out.println(b);
}
}
上述程序导致4835.0
class First
{
public static void main(String[] args)
{
double b = 012e3;
System.out.println(b);
}
}
上述程序导致12000
请解释以上输出。
不是你最后一个问题中的选民,而是[这个问题和答案](https://stackoverflow.com/questions/39805105/where-does-the-constructor-invocation-get-stored-stack-or-heap)是相关的。请注意,[询问之前先搜索]总是一个好主意(https://www.google.com/#q=java+does+calling+a+constructor+use+stack+memory) –