摘要:
public static void main(String[] args) { System.out.println("请输入值,以回车结束:"); Scanner sc = new Scanner(System.in); sc.useDelimiter("\n"); while (sc.hasNext()) { String s = sc.next(); System.out.println("获取值:"+s); } }1.用Scanner类封装system.in输入流2.sc.userDelimiter("\n&quo 阅读全文