标签:令行 exti int() cat pack ann private nts bsp
package com.study; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class InputFromCommandLine { public static void main(String[] args) { input2(); } private static void input1() { try (Scanner sc = new Scanner(System.in)) { System.out.println("Input a num:"); int value = sc.nextInt(); System.out.println("Value Input:" + value); } catch (Exception e) { e.printStackTrace(); } } private static void input2() { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { System.out.println("Input a num:"); String value = br.readLine(); System.out.println("Value Input:" + value); } catch (IOException e) { e.printStackTrace(); } } }
标签:令行 exti int() cat pack ann private nts bsp
原文地址:https://www.cnblogs.com/luffystory/p/9739358.html