luohzzz

导航

day04

数据类型

强:safe性高、编译速度慢一点

:safe性相对不高、但很流行

变量要符合规定!!!

public class dome {
   public static void main(String[] args) {
      char a ='我';
      char b ='是';
      char c ='罗';
      char d ='焕';
      char e ='钊';
       int r = 10;
       int r2 = 010;
       int r3 = 0x10;
       System.out.println(a);
       System.out.println(b);
       System.out.println(c);
       System.out.println(d);
       System.out.println(e);
       System.out.println((int)a);
       System.out.println((int)b);
       System.out.println((int)c);
       System.out.println((int)d);
       System.out.println((int)e);
       System.out.println("-------------------------------------------------------------------------------");
       float num1 =365.1f;
       double num2 =365.1;
       System.out.println(num1);
       System.out.println(num2);
       System.out.println("-------------------------------------------------------------------------------");
       System.out.println(num1==num2);
       float a3 = 365.2f;
       float a4 = a3 + 1;
       System.out.println(a3==a4);
  }
}
public class dome2 {
   public static void main(String[] args) {
       System.out.println("hello\tworld");
       System.out.println("hello\nworld");
       System.out.println("hello,world");
       boolean flag = true;
       if (flag){
           System.out.println("我是罗焕钊");
      }
  }
}

 

posted on 2021-04-20 17:29  luohzzz  阅读(225)  评论(0编辑  收藏  举报