第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

輸出:沒有錯誤您可能分配了太多內(nèi)存 任何人都可以詳細(xì)解釋

輸出:沒有錯誤您可能分配了太多內(nèi)存 任何人都可以詳細(xì)解釋

茅侃侃 2021-12-01 19:41:12
查看以下源代碼class Test{    public static void main(String[] args)    {        Double object = new Double("2.4");        int a = object.intValue();        byte b = object.byteValue();        float d = object.floatValue();        double c = object.doubleValue();        System.out.println(a + b + c + d );    }}輸出:沒有錯誤您可能分配了太多內(nèi)存誰能詳細(xì)解釋一下
查看完整描述

2 回答

?
慕的地10843

TA貢獻(xiàn)1785條經(jīng)驗(yàn) 獲得超8個贊

將您的代碼更改為


Double object = new Double("2.4");

int a = object.intValue();

byte b = object.byteValue();

float d = object.floatValue();

double c = object.doubleValue();


System.out.println(a);        

System.out.println(a + b);        

System.out.println(a + b + c);        

System.out.println(a + b + c + d );   

并探索


查看完整回答
反對 回復(fù) 2021-12-01
?
繁星淼淼

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超11個贊

如果有人仍在尋找為什么 15 位小數(shù)精度出現(xiàn)的答案。


public class JavaExample {


    public static void main(String[] args) {

        Double object = new Double("2.4");

        int a = object.intValue();

        byte b = object.byteValue();

        float c = object.floatValue();

        double d = object.doubleValue();

        float e = object.floatValue();

        double f = object.doubleValue();


        System.out.println("int :"+a);        

        System.out.println("int and byte addition :"+(a + b));        

        System.out.println("int, byte and float addition :"+(a + b + d));        

        System.out.println("int, byte, float and double addition :"+(a + b + c + d));   

        System.out.println("float and double addition :"+(c + d));  

        System.out.println("float and float addition :"+(c + e)); 

        System.out.println("double and double addition :"+(d + f)); 

        System.out.println("float and double addition :"+(e + f)); 

    }

}

Output:

int :2

int and byte addition :4

int, byte and float addition :6.4

int, byte, float and double addition :8.800000095367432

float and double addition :4.800000095367432

float and float addition :4.8

double and double addition :4.8

float and double addition :4.800000095367432


查看完整回答
反對 回復(fù) 2021-12-01
  • 2 回答
  • 0 關(guān)注
  • 159 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號