Thinking in java (2)----primitive types

来源:互联网 发布:易语言支付宝转账源码 编辑:程序博客网 时间:2024/05/02 04:37

       

     The variable holds the value directly and the object is stored in the stack, so the primitive type variable is more efficient than the obecjt by using new.

     boolean         ---                         true/false                   Boolean

       char                2byte                  0--2^16-1                    Character

       byte                 1byte                 -2^8       2^8-1             Byte

       short              2byte                   -2^15    2^15-1           Short

       int                   4byte                   -2^31    2^31-1           Integer

       long               8byte                   -2^63    2^63-1           Long

       float               4byte                  IEEE754    IEEE754          Float

       double          8byte                   IEEE754   IEEE754          Double

0 0
原创粉丝点击