java学习之i/o
基本的输入输出 这里有两种方法,其中一种被注释了,可以换着注释后测试一遍
class TestSystem { public static void main(String[] args) { /* InputStream is = System.in; Scanner ac = new Scanner(is); System.out.println("input your name"); String name = ac.next(); System.out.println("your name is :"+name); */ Scanner in = new Scanner(System.in); System.out.println(" your name"); String a = in.next(); System.out.println("your name is :"+a); } }
不积跬步,无以至千里。