<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    常用鏈接

    統計

    最新評論

    Special case: primitive types

     

    Special case: primitive types

    Java determines the size of each primitive type. These sizes don’t change from one machine

    architecture to another as they do in most languages. This size invariance is one reason Java

    programs are more portable than programs in most other languages.

     

     

    All numeric types are signed, so don’t look for unsigned types.

    The size of the boolean type is not explicitly specified; it is only defined to be able to take the literal values true or false.

    The “wrapper” classes for the primitive data types allow you to make a non-primitive object on the heap to represent that primitive type. For example:

    char c = 'x';

    Character ch = new Character(c);

    Or you could also use:

    Character ch = new Character('x');

    Java SE5 autoboxing will automatically convert from a primitive to a wrapper type:

    Character ch = 'x';

    and back:

    char c = ch;

    The reasons for wrapping primitives will be shown in a later chapter.

    High-precision numbers

    Java includes two classes for performing high-precision arithmetic: BigInteger and

    BigDecimal. Although these approximately fit into the same category as the “wrapper” classes, neither one has a primitive analogue.

    Both classes have methods that provide analogues for the operations that you perform on

    primitive types. That is, you can do anything with a BigInteger or BigDecimal that you can with an int or float, it’s just that you must use method calls instead of operators. Also, since there’s more involved, the operations will be slower. You’re exchanging speed for accuracy.

    BigInteger supports arbitrary-precision integers. This means that you can accurately represent integral values of any size without losing any information during operations.

    BigDecimal is for arbitrary-precision fixed-point numbers; you can use these for accurate

    monetary calculations, for example.

     

    OX1231×1622×1613×160

    posted on 2008-05-20 13:12 九寶 閱讀(197) 評論(0)  編輯  收藏 所屬分類: Java Study(JavaThinking4)

    主站蜘蛛池模板: 国产精品成人四虎免费视频| 久久久久久国产a免费观看黄色大片| 成年在线网站免费观看无广告| 亚洲无限乱码一二三四区| 久久A级毛片免费观看| 亚洲丁香色婷婷综合欲色啪| 久久精品一区二区免费看| 亚洲电影一区二区| **一级一级毛片免费观看| 亚洲欧洲日本国产| 国产卡一卡二卡三免费入口| 黄色毛片免费网站| 四虎在线播放免费永久视频| 一级一级毛片免费播放| 亚洲色大成网站www永久一区| 日韩免费电影网址| 91亚洲性爱在线视频| 成年女人色毛片免费看| 免费国产污网站在线观看不要卡| 亚洲精品第一国产综合精品99 | 免费精品国产自产拍观看| 国产亚洲综合精品一区二区三区| 亚洲成?v人片天堂网无码| 久久精品免费大片国产大片 | 亚洲精品在线电影| 国产亚洲高清不卡在线观看| 久久亚洲中文字幕精品有坂深雪| 无码国产精品一区二区免费3p| 亚洲精品美女久久久久9999| 免费激情视频网站| eeuss免费天堂影院| 亚洲天堂一区二区三区| 国产又黄又爽又猛的免费视频播放| 一区二区三区免费视频网站| 久久久久亚洲AV无码永不| 日韩免费福利视频| 国产免费一区二区视频| 亚洲乱理伦片在线观看中字| 亚洲精品国产精品乱码在线观看| 一个人看www在线高清免费看| 一二三四在线观看免费中文在线观看 |