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) –