输出语句:System.out.println("");

解决方案 »

  1.   

    输入语句:System.in.read("");
    不过要输入一连串的字符就长了
      

  2.   

    输入:
    简单的可以是int i=System.in.read(); 及使用System.in这个类
    高级用法查阅有关InputStream类的资料输出相反,分别是:System.out和OutputStream
      

  3.   

    给你段例子代码
    public class Teststream {
    public static void main(String[] args) {
    InputStreamReader is = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(is);
    System.out.println("please input a number");
    String s = "";
    try {
    s = br.readLine();
    } catch (IOException e) {
    System.out.println("xxxxxxxxxx");
    }
    System.out.println(s + "-------------");
    }}
      

  4.   

    java中进行输入输出方面相比C来对初学者来说是麻烦了一点,有着一整套的流系统。
    建议系统的学习一下有关流(STREAM)方面的知识相。
    也可以使用JOptionPane.showInputDialog(String prompt)来弹出一个对话框进行输入。若要进行控制台输入的话,可以使用:
    Systme.in.read(byte [] b);会把读取的数据放出数组B中,如果出错,抛出IOException.用回车键结束输入,但是回车键也会当作一个输入字符输入。
      

  5.   

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String input;
    try {
      input = br.readLine();
      System.out.println(input);
    } catch(IOException ioe) {
      
    }
      

  6.   

    现在 1.5 有了可以使用 java.util.Scanner例子:
         Scanner sc = new Scanner(System.in);
         int i = sc.nextInt();
      

  7.   

    mlovex(史吹真悟) 你的代码错误太多了.
      

  8.   

    int i=System.in.read(); 
    为啥我我读出的数据不是我输入的数据?