Java 题库—175 道选择题(69 页)Good is good, but better carries it.精益求精,善益求善。 《Java 程序设计》理论题库—选择题(单选 175 题) 1.欲构造 ArrayList 类的一种实例,此类继承了 List 接口,下列哪个措施是对的的 ? BA、 ArrayList myList=new Object(); B、 List myList=new ArrayList(); C、 ArrayList myList=new List(); D、 List myList=new List();2.paint()措施使用哪种类型的参数? AA、 Graphics B、 Graphics2D C、 String D、 Color3.指出对的的体现式 DA、 byte=128; //byte 取值到 127B、 Boolean=null; C、 long l=0xfffL; D、 double=0.9239d; 4.指出下列程序运行的成果 Bpublic class Example{ String str=new String("good"); char[]ch={'a','b','c'}; public static void main(String args[]){ Example ex=new Example(); ex.change(ex.str,ex.ch); System.out.print(ex.str+" and "); Sytem.out.print(ex.ch); } public void change(String str,char ch[]){ str="test ok"; ch[0]='g'; } } A、 good and abc B、 good and gbc C、test ok and abc D、 test ok and gbc 5.运行下列程序, 会产生什么成果 C Dpublic class X extends Thread implements Runable{ public void run(){ System.out.println("this is run()"); } public static void main(String args[]) { Thread t=new Thread(new X()); t.start(); } } A、 第一行会产生编译错误 B、 第六行会产生编译错误 C、 第六行会产生运行错误 D、 程序会运行和启动 6.要从文献" file.dat"文献中读出第 10 个字节到变量 C 中,下列哪个措施适合? AA、 FileInputStream in=new FileInputStream("file.dat"); in.skip(9); int c=in.read(); B、 FileInputStream in=new FileInputStream("file.dat"); in.skip(10); int c=in.read(); C、 FileInputStream in=new FileInputStream("file.dat"); int c=in.read(); D、 RandomAccessFile in=new RandomAccessFile("file.dat"); in.skip(9); int c=in.readByte(); 7.容器被重新设置大小后,哪种布局管理器的容器中的组件大小不随容器大小的变化而变化? BA、 CardLayout B、 FlowLayout C、 BorderLayout D、 G...