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

猜你喜欢

转载自blog.csdn.net/Iverson941112/article/details/85247240