35.有一 File 類別物件 f,它將以方法 exists 檢查該檔案是否存在,下列 JAVA 程式碼何者最適宜?
(A) Exception e= new IOException( “File not found!”);
if (!f.exists()) throw e;
(B) if (!f.exists()) throw “File not found!”);
(C) if (!f.exists()) throw new IOException ();
(D) if (!f.exists()) throw new IOException ( “File ” +f.getName()+ “not found!”)
答案:登入後查看
統計: A(1), B(1), C(0), D(10), E(0) #3307197
統計: A(1), B(1), C(0), D(10), E(0) #3307197