1.基础
package com.foreknow.test;
/*
- java中的数据类型
整型:byte short int long
浮点型:float double(默认类型为double 定义浮点型需要在值后面加F)
布尔类型:boolean true flase
字符类型:char
8种基本数据类型 byte short int long float double boolean char
*/
public class Var {
public static void main(String[] args) {
int x = 10;
int y = 20;
double z = 3.14;
float f = 1.23F;
boolean isright = true;
char c = 'c';
String tString = "aaaaa";
// 学号
// 姓名
// 性别
// 年龄
// 所在学校
// 婚否
// 收入
int sid = 15;
String name = "xiaowang";
String sex = "boy";
int age = 18;
String school = "sylu";
boolean marry = false;
double salary = 180000.1111;
System.out.println("学生的学号为:"+sid);
System.out.println("------------------");
System.out.println("学生的姓名为:"+name);
System.out.println("------------------");
System.out.println("学生的性别为:"+sex);
System.out.println("------------------");
System.out.println("学生的年龄为:"+age);
System.out.println("------------------");
System.out.println("学生所在学校为:"+school);
System.out.println("------------------");
System.out.println("学生的婚姻状况是:"+marry);
System.out.println("------------------");
System.out.println("学生的收入是:"+salary);
}
}