public class Demo02 { public static void main(String[] args) { //八大基本数据类型 int num1 = 10; byte num2 = 20; short num3 = 30; long num4 = 30L;//Long类型要在数字后面加个L //小数: 浮点型 float num5 = 50.1F;//float类型要在数字后面加个F double num6 = 3.1415926; //字符 char name = 'A'; //字符串,String不是关键子,类 String namea = "lixiaohang"; //布尔值;是非 boolean flag = true; //boolean flag = false; } }