标签:strong system 方法 对象 asn next print can string
Scanner s = new Scanner(System.in);
import java.util.*;public class Main
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("输入数据");
String str = scanner.next();
System.out.println(str);
//输入"Hello World" 输出"Hello"
}
}
import java.util.*;public class Main
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("输入数据");
String str = scanner.nextLine();
System.out.println(str);
//输入"Hello World" 输出"Hello World"
}
}
标签:strong system 方法 对象 asn next print can string
原文地址:https://www.cnblogs.com/chibadream/p/14382311.html