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);
	
	}
}

 

posted @ 2013-08-25 23:13  shoneworn  阅读(186)  评论(0编辑  收藏  举报