日期:2014-05-20  浏览次数:20652 次

java.util.Scanner
请问:我要通过控制台输入字符串,这个变量等式应该怎么写?

------解决方案--------------------
Scanner sc = new Scanner(System.in);
String str = sc.next();
------解决方案--------------------
探讨
Scanner sc = new Scanner(System.in);
String str = sc.next();

------解决方案--------------------
探讨
Scanner sc = new Scanner(System.in);
String str = sc.next();

------解决方案--------------------
探讨
引用:
Scanner sc = new Scanner(System.in);
String str = sc.next();

String s = sc.nextLine();
int i = sc.nextInt();
double d = sc.nextDouble();
查下API 就清楚了

------解决方案--------------------
探讨

Scanner sc = new Scanner(System.in);
String str = sc.next();

------解决方案--------------------
Scanner scanner = new Scanner(System.in);
System.out.println("请输入用户名:");
 String content= scanner.nextLine();
Sysout.out.println(content);
------解决方案--------------------
1L right
------解决方案--------------------
探讨

Scanner sc = new Scanner(System.in);
String str = sc.next();

------解决方案--------------------
探讨
引用:
引用:
Scanner sc = new Scanner(System.in);
String str = sc.next();

String s = sc.nextLine();
int i = sc.nextInt();
double d = sc.nextDouble();
查下API 就……