变量的基本演示

来源:互联网 发布:淘宝直通车使用教程 编辑:程序博客网 时间:2024/05/22 03:43

基本数据类型:

1byte = 8bit = 00000000;

1byte      2byte       4byte   8byte

byte        short        int        long

                               float     double

               char

boolean(1bit)


long a = 123l; //字母“l”作为长整型标志时务必大写

应为:long a = 123L;


整数默认:int 小数默认:double

float b = 2.3; //默认2.3为double

应为:float b = 2.3f;

0 0
原创粉丝点击