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

    主站蜘蛛池模板: 亚洲综合欧美色五月俺也去| 亚洲avav天堂av在线不卡| 久久精品国产亚洲AV久| 亚洲日本一区二区三区在线| 久久亚洲精品无码AV红樱桃| 亚洲日韩中文字幕一区| 在人线av无码免费高潮喷水| 亚洲av午夜精品无码专区| 8x8x华人永久免费视频| 亚洲第一永久AV网站久久精品男人的天堂AV | 亚洲a级成人片在线观看| 成年人视频免费在线观看| 亚洲午夜无码片在线观看影院猛 | 1000部啪啪未满十八勿入免费| 亚洲国产精品无码久久SM| 免费成人在线视频观看| 免费人成视网站在线观看不卡| 香蕉蕉亚亚洲aav综合| 久久这里只精品国产免费10| 亚洲美女视频一区| 最近中文字幕无免费视频| 国产成人精品亚洲| 亚洲中文字幕无码一区 | 亚洲乱色熟女一区二区三区丝袜| 国产无遮挡又黄又爽免费网站 | 又粗又黄又猛又爽大片免费| 中文字幕无线码免费人妻| 亚洲三级电影网址| 无码一区二区三区AV免费| 黄页网址在线免费观看| 亚洲AV无码专区国产乱码电影| 97公开免费视频| 春暖花开亚洲性无区一区二区| 噼里啪啦免费观看高清动漫4| 亚洲国产精品99久久久久久| 国产h视频在线观看网站免费| 亚洲AV无码一区二区一二区| 在线视频免费观看www动漫| 亚洲va成无码人在线观看| 亚洲不卡AV影片在线播放| 99xxoo视频在线永久免费观看|