A.一定要繼承java.beans.Beans B.一定要實(shí)現(xiàn)Runnalbe接口 C.一定要繼承java.lang.Thread類 D.可以不繼承java.beans.Beans
A.File f = new File("/","autoexec.bat"); B.DataInputStream din = new DataInputStream(new FileInputStream("autoexec.bat")); C.InputStreamReader in = new InputStreamReader(System.in); D.OutputStreamWriter out = new OutputStreamWriter(System.in);
在J2EE中,如果去編譯并運(yùn)行下面的代碼,在這里假定在當(dāng)前目錄下沒(méi)有Hello.txt文件: import java.io.*; public class Mine { public static void main(String argv[]){ Mine m=new Mine(); System.out.println(m.amethod()); } public int amethod() { try { FileInputStream dis=new FileInputStream("Hello.txt"); } catch (FileNotFoundException fne) { System.out.println("No such file found"); return -1; } catch(IOException ioe) { } finally { System.out.println("Doing finally"); } return 0; } } 結(jié)果會(huì)輸出()。
A.No such file found B.No such file found -1 C.No such file found doing finally -1 D.0