Code example for Scanner

Methods: nextLong

0
public class Responsibility { 
 
	public static void main(String[] args) {
		// 从控制台输入数字 
		System.out.println("请输入你要处理的数字:");
		Scanner input = new Scanner(System.in);
		Long testObject = input.nextLong();
		Handler handler = new HandlerImplOne(); 
		String info = handler.dealWith(testObject);
		System.out.println(info);
	} 
 
}