Q:如何从键盘输入字符串,再赋给字符串对象
A: public String getstring() throws IOException{ InputStreamReader isr =new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); return br.readLine(); }
Q:如何获得某一个目录下的文件列表
A: File MyDir = new File(“C:/Windows/.”); String[] FileNames = MyDir.list();