一下的方法是想实现输入的功能:
static void hirerinformation()
{
System.out.println("请输入你的信息:姓名--性别--身份证号");
Scanner input_1 = new Scanner(System.in);
char name = input_1.nextChar();
System.out.println("name:"+name);
Scanner input_2 = new Scanner(System.in);
char sex = input_2.nextChar();
System.out.println("sex:"+sex);
Scanner input_3 = new Scanner(System.in);
int id = input_3.nextInt();
System.out.println("id:"+id);
}
想要的效果是;
name:张三
sex:男
id:10000000000000
请大虾们赐教 谢谢各位了
跪求!!!!!!!
------解决方案--------------------
- Java code
System.out.println("请输入你的信息:姓名--性别--身份证号"); Scanner input_1 = new Scanner(System.in); System.out.print("name:"); String name = input_1.next(); Scanner input_2 = new Scanner(System.in); System.out.print("sex:"); String sex = input_2.next(); Scanner input_3 = new Scanner(System.in); System.out.print("id:"); int id = input_3.nextInt(); System.out.println("你输入的信息是:name:" + name + "; sex:" + sex + "; id:" + id);
------解决方案--------------------
一楼的方法是正确的//////