1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /**
- * ClassName: Test01
- *
- * @Author 爱扣钉-陈晨
- * @Create 2023/10/21 15:31
- * @Version 1.0
- */
- public class Test02 {
- public static void main(String[] args) {
- //整数
- byte a = 127; // 超出报错
- short b = 128;
- int c = 1234567891;
- long d = 12345678910L; //数值 取int long类型需要加 L
- // 小数
- float e = 1.1234567890F; // 加F
- double f = 1.123456789987654321; // 可以加D
- // char
- char g = 'C'; //单引号
- // boolean
- boolean h = true;
- //使用变量输出
- System.out.println(a);
- System.out.println(b);
- System.out.println(c);
- System.out.println(d);
- System.out.println(e);
- System.out.println(f);
- System.out.println(g);
- System.out.println(h);
- }
- }
|