//导包:import java.util.Scanner;
import java.util.Scanner;
class day3b{
public static void main(String[] args){
//实例化:Scanner scan = new Scanner(System.in);
Scanner scan = new Scanner(System.in);
//3.调用Scanner类的相关方法
System.out.println("请输入以下您的信息:");
System.out.println("姓名:");
String name = scan.nextLine();
System.out.println(name);
System.out.println("性别:");
String gender = scan.nextLine();
System.out.println(gender);
System.out.println("年龄:");
int age = scan.nextInt();
System.out.println(age);
System.out.println("身高:");
double height = scan.nextDouble();
System.out.println(height);
System.out.println("请确认以上信息是否正确(true/false)");
boolean confirm = scan.nextBoolean();
System.out.println(/confirm/i);
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)