1. import java.util.*; 2. class ForInTest { 3. static List list = new ArrayList(); 4. 5. static List getList() { return list; } 6. 7. public static void main(String [] args) { 8. list.add("a"); list.add("b"); list.add("c"); 9. // insert code here 10. System.out.print(o); 11. } 12. } 第 9 行插入哪一项将输出 abc?()
import java.io.*; public class Forest implements Serializable { private Tree tree = new Tree(); public static void main(String [] args) { Forest f= new Forest(); try { FileOutputStream fs = new FileOutputStream(”Forest.ser”); ObjectOutputStream os = new ObjectOutputStream(fs); os.writeObject(f); os.close(); } catch (Exception ex) { ex.printStackTrace(); } } } class Tree { } What is the result?()
import java.io.PrintWriter; class DoFormat { public static void main(String [] args) { int x = 42; int y = 12345; float z = 7; System.out.format("-%4d- ", x); System.out.format("-%4d- ", y); System.out.format("-%4.1d- ", z); } } 结果为:()
When importing a table into a database,the import process performs these tasks: 1. Triggers are imported. 2. Data is imported. 3. New tables are created. 4. Indexes are built. 5. Any bitmap, functional, and/or domain indexes are built. 6. Integrity constraints are enabled on the new tables. Which option shows the tasks in the order in which they are performed?()
1. import java.util.*; 2. class AddStuff { 3. public static void main(String [] args) { 4. TreeSet〈String〉 s = new TreeSet〈String〉(); 5. s.add("one"); 6. s.add("two"); 7. // insert code here 8. for(String s2 : sorted) 9. System.out.print(s2 + " "); 10. } 11. } 和四个代码片段: s1. SortedSet sorted = s.tailSet(s.first()); s2. SortedSet〈String〉 sorted = s.tailSet(s.first()); s3. SortedSet sorted = (SortedSet)s.tailSet(s.first()); s4. SortedSet sorted = (SortedSet〈String〉)s.tailSet(s.first()); 分别插入到第7行,哪项可以编译?()
在J2EE中,如果去编译并运行下面的代码,在这里假定在当前目录下没有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; } } 结果会输出()。
现有: 1. import java.util.*; 2. class AddStuff { 3.public static void main (String [] args) { 4.TreeSet s= new TreeSet(); 5. s.add( "one"): 6. s.add( "two"): 7. //insert code here 8.for (String s2: sorted) 9.System.out.print (s2+" "); 10. } 11. } 和四个代码片段: s1.sortedSet sorted=s.tailSet(s.first()); s2.sortedSet sorted=s.tailSet(s.first()); s3.sortedSet sorted= (SortedSet)s .tailSet(s.first()); s4.SortedSet sorted= (SortSet)s .tailSet(s.first()); 分别插入到第7行,哪项可以编译?()
CSS引入的方式有哪些? link和@import的区别是?
魏源在《海国图志》中使用了很多新词语,如政治(politics)、进口(import)、出口(export)、新闻纸(newspaper)、铁路(railway)、铁辙(track)、火轮机(1iterature)等。这段材料表明魏源()
在J2EE中,有如下代码在Servlet1.java中 Import javax.servlet.*; Import javax,servlet.http.*; Import java.io,IOException; Import java.io.PrintWriter; Public class Servlet1 extends HttpServlet{ Public void init() throws ServletException{} Public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{ PrintWriter out = reponse.getWriter(); Out.println("hello!"); } } 假如要编 译的环境已都已经搭建好。现在用完全正确的命令编译该文件,对于以下陈述正确的是();