《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
print(ex
str+" and "); Sytem
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
运营下列程序, 会