- list 是一個(gè)合法的集合引用 - getCollection() 返回一個(gè)合法集合的引用 哪兩個(gè)是合法的()
A.for(Object o ; list) B.for(Object o : list.iterator()) C.for(Object o : getCollection()) D.for(Iterator i = list.iterator(); i.hasNext (); )
1. class SuperFoo { 2. SuperFoo doStuff(int x) { 3. return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 下面哪三項(xiàng)分別插入到第8行,可以編譯?()
A.int doStuff() { return 42; } B.int doStuff(int x) { return 42; } C.Foo doStuff(int x) { return new Foo(); } D.SuperFoo doStuff(int x) { return new Foo(); }
A.訪問本地文件系統(tǒng) B.打開除運(yùn)行Applet 的主機(jī)外的另一個(gè)主機(jī)的Socket C.在運(yùn)行環(huán)境中執(zhí)行另一個(gè)程序 D.試圖讀取不存在的文件