1. 程式人生 > >JAVA#輸入輸出練習 札記

JAVA#輸入輸出練習 札記

public String InOutpu(){
        InputStreamReader isr=new InputStreamReader(System.in);
        BufferedReader br=new BufferedReader(isr);
        String str=null;
        try{
        str=br.readLine();
    }catch (IOException e){
            e.printStackTrace();
        }
        return str;

        }

    public static void main(String[] args) {
        System.out.println("Please input an array:");
        TESTRandomAccess tra=new TESTRandomAccess();
        String s=tra.InOutpu();
        System.out.println(s);
    }
Please input an array:
fsadfasf
fsadfasf