八大数据类型
public class Demo02 {
public static void main(String[] args) {
int num1 = 10;
byte num2 = 20;
short num3 = 30;
long num4 = 30L;
float num5 = 50.1F;
double num6 = 3.141591645252893457198;
char name = '国';
boolean flag = true;
}
}
public class Demo02 {
public static void main(String[] args) {
int num1 = 10;
byte num2 = 20;
short num3 = 30;
long num4 = 30L;
float num5 = 50.1F;
double num6 = 3.141591645252893457198;
char name = '国';
boolean flag = true;
}
}

进制表示和数据类型扩展
public class Demo03 {
public static void main(String[] args) {
int i = 10;
int i2 = 010;
int i3 = 0x10;
System.out.println(i);
System.out.println(i2);
System.out.println(i3);
System.out.println("==================================");
float f = 0.1f;
double d = 1.0/10;
System.out.println(f==d);
System.out.println(f);
System.out.println(d);
float f1 = 65376519;
float f2 = f1+1;
System.out.println(f1==f2);
System.out.println("===================================================");
char c1 = 'a';
char c2 = '中';
System.out.println(c1);
System.out.println((int)c1);
System.out.println(c2);
System.out.println((int)c2);
System.out.println("===================================================");
String s1 = new String("hello,world");
String s2 = new String("hello,world");
System.out.println(s1==s2);
String s3 = "hello,world";
String s4 = "hello,world";
System.out.println(s3==s4);
boolean flag = true;
if (flag==true){
}
if (flag) {
}
}
}