java 怎么实现接收控制台输入?

//接收键盘输入:
//怎么实现接收控制台输入?
import java.util.Scanner;

//Test.java
import java.util.Scanner;
public class Test16{
    public static void main(String args[]){
        System.out.println("input a number:");
        Scanner in =new Scanner(System.in);
        int x1=in.nextInt();
        System.out.println("input a number:");
        int x2=in.nextInt();
        int x3=x1+x2;
        System.out.println("x1+x2="+x3);
    }
}

 

posted @ 2015-09-18 23:27  Xiao|Deng  阅读(1802)  评论(0编辑  收藏  举报