A.一个方法不能够覆盖成 private的。 B.静态方法不能够被覆盖。 C. private方法不能够被覆盖 D.一个覆盖的方法不能够抛出基类中非 checked异常( Runtime Exception) 下列那个是char类型的值的范围? A.-22-1 D.0~23 39、以下选项中循环结构合法的是? A. while (int i<7) System. out. println('i is" +i) while(i) I System. out. printIn(j is"+j) C. int j=0 for(intk=0;j+k!=10;j++,k++){ System. out. println( D. int j=0: System. out. println(j is+++) f(j==3)continue loop: 1 ) while (j<10) 40、下面哪些是短整型 short的取值范围: BCD 多选题 1、执行下列代码后哪个结论是正确的 Stringl s= new String[10 As[10]为 Bs9]为nul Cs[o]为未定义 D S length为10 2、下面的表达式哪个是正确的? A String s="你好";inti=3;s+=i B String s="你好"inti=3:if(i=s){S+≡} C String s="你好"inti=3;s=i+s; D String s="你好";intj=3;s=i计 E String s=null; int i=(sl=null)&&(s length>0)?s length(: 0; 3、关于foat类型下面哪三个是正确的? A. float foo=-1
A. 一个方法不能够覆盖成 private 的。 B. 静态方法不能够被覆盖。 C. private 方法不能够被覆盖。 D. 一个覆盖的方法不能够抛出基类中非 checked 异常(Runtime Exception)。 38、 下列那个是 char 类型的值的范围? A. -27 ~27 -1 B. 0~216-1 C. 0~216 D. 0~28 39、 以下选项中循环结构合法的是? A. while (int i<7) { i++; System.out.println("i is "+i); } B. int j=3; while(j) { System.out.println(" j is "+j); } C. int j=0; for(int k=0; j + k !=10; j++,k++){ System.out.println(" j is "+ j + "k is"+ k); } D. int j=0; do{ System.out.println( "j is "+j++); if (j = = 3) {continue loop;} }while (j<10); 40、 下面哪些是短整型 short 的取值范围: A.-27 ——27 -1 B.0 ——215 C.–215 —— 215-1 D.–231 ——231-1 二、 多选题 1、执行下列代码后,哪个结论是正确的 String[] s=new String[10]; A s[10] 为 ""; B s[9] 为 null; C s[0] 为 未定义 D s.length 为 10 2、下面的表达式哪个是正确的? A String s="你好";int i=3; s+=i; B String s="你好";int i=3; if(i==s){ s+=i}; C String s="你好";int i=3; s=i+s; D String s="你好";int i=3; s=i+; E String s=null; int i=(s!=null)&&(s.length>0)?s.length():0; 3、关于float类型下面哪三个是正确的? A. float foo=-1;
B. float foo=1.0: C. float foo=42e 1 D. float foo=2, 02f E. float foo=3. 03d F float foo=0x0123. 4、关于下面的代码片段,请选择正确的 ConstOver构造方法的重载方法? public class Constovert public Constover(int x, int y, int z)t B protected int Constovero / not overload, but no a error C private Constover(int Z, int y, byte x) D. public void Constover(byte x, byte y, byte z)t E public Object Constover(int x, int y, int z) 5、关于下面的代码片段,请选择正确的 setVar的覆盖方法? public class MethodOvert public void setVar(int a, int b, float c) A private void setVar(int a, float C, int b)0 B protected void setVar(int a, int b, float c) C public int setVar(int a, float c, int b return a: D public int setVar(int a, float chretum a 1 6、下面的选择项目中哪个成功地创建了 Vector的一个实例,并且添加了一个元素? A Vector v=new Vector( 99) v1]=99 B Vector v=new Vector vaddElement(99) C Vector v=new Vector v.add(99): D. Vector v=new Vector(100) vaddElement( 99") 7、使用Fie类你能够完成下面的哪些任务? A.改变当前文件夹。 B.返回父文件夹的名字。 C.删除文件。 D.查询是否一个文件中包含文件信息还是二进制信息。 8、下面正确的创建 Socke的语句有 A Socket a= new Socket(80) B Socket b= new Socket( 130.3.4.5, 80) C ServerSocket c= new Socket(80) D ServerSocket d= new Socket( 130.3 4.5, S
B. float foo=1.0; C. float foo=42e1; D. float foo=2.02f; E. float foo=3.03d; F. float foo=0x0123; 4、关于下面的代码片段,请选择正确的ConstOver构造方法的重载方法? public class ConstOver{ public ConstOver(int x, int y, int z){} } A.ConstOver(){} B.protected int ConstOver(){} //not overload ,but no a error C.private ConstOver(int z, int y, byte x){} D.public void ConstOver(byte x, byte y, byte z){} E.public Object ConstOver(int x, int y, int z){} 5、关于下面的代码片段,请选择正确的setVar的覆盖方法? public class MethodOver{ public void setVar(int a, int b, float c){} } A.private void setVar(int a, float c, int b){} B.protected void setVar(int a, int b, float c){} C.public int setVar(int a, float c, int b){return a;} D.public int setVar(int a, float c){return a;} 6、下面的选择项目中哪个成功地创建了Vector的一个实例,并且添加了一个元素? A. Vector v=new Vector(99); v[1]=99; B. Vector v=new Vector(); v.addElement(99); C. Vector v=new Vector(); v.add(99); D. Vector v=new Vector(100); v.addElement("99"); 7、使用File类你能够完成下面的哪些任务? A. 改变当前文件夹。 B. 返回父文件夹的名字。 C. 删除文件。 D. 查询是否一个文件中包含文件信息还是二进制信息。 8、下面正确的创建Socket的语句有 A Socket a = new Socket(80); B Socket b = new Socket("130.3.4.5",80); C ServerSocket c = new Socket(80) D ServerSocket d = new Socket("130.3.4.5",80)
9、下面关于阻塞方法的论述,正确的有? A阻塞方法是指无法返回的方法 B阻塞方法是指网络过于繁忙,方法必须等待 C阻塞方法是指有外部事件发生才会返回的方法。 D阻塞方法如果不能马上返回,就会进入等待状态,把系统资源让给其他线程 10、下面正确的论述有? A ServerSocket accept是阻塞的 B Buffered Reader readline是阻塞的 C DatagramSocket receive是阻塞的 D Datagram Socket send是阻塞的 11、给定下列代码 public class Parent I blic int add Value( int a, int b)t s= a+b: return s: class Child extends Parent 下列哪些方法可以作为Chd类的方法 A int add Value( int a, int b )l do something.] B. public void addvalue o/ do something.] C public int addValue( int a ]/ do something. D. public int add Value( int a, int b )throws MyException (//do something.3 下面的哪些程序片断可能导致错误? A String s="Gone with the wind", String t=good", String k=s+t B String s= "Gone with the wind String t=s[3]+one C. String s="Gone with the wind String standard =s. toUpperCaseo String s= home directory String t=s-directory 13、下列哪些接口在Java中没有定义相对应的 Adapter类? A. MouseListener B. KeyListener C. Actionlistener D. ItemListene E. Window Listener 那些类可以用来实现TCP/P客户服务器程序? A ServerSocket
9、下面关于阻塞方法的论述,正确的有? A 阻塞方法是指无法返回的方法 B 阻塞方法是指网络过于繁忙,方法必须等待 C 阻塞方法是指有外部事件发生才会返回的方法。 D 阻塞方法如果不能马上返回,就会进入等待状态,把系统资源让给其他线程 10、 下面正确的论述有? A ServerSocket.accept是阻塞的 B BufferedReader.readLine是阻塞的 C DatagramSocket.receive是阻塞的 D DatagramSocket.send是阻塞的 11、 给定下列代码: public class Parent { public int addValue( int a, int b) { int s; s = a+b; return s; } } class Child extends Parent { } 下列哪些方法可以作为 Child 类的方法? A. int addValue( int a, int b ){// do something...} B. public void addValue (){// do something...} C. public int addValue( int a ){// do something...} D. public int addValue( int a, int b )throws MyException {//do something...} 12、 下面的哪些程序片断可能导致错误? A. String s = "Gone with the wind"; String t = " good "; String k = s + t; B. String s = "Gone with the wind"; String t; t = s[3] + "one"; C. String s = "Gone with the wind"; String standard = s.toUpperCase(); D. String s = "home directory"; String t = s - "directory"; 13、 下列哪些接口在Java中没有定义相对应的Adapter类? A. MouseListener B. KeyListener C. ActionListener D. ItemListener E. WindowListener 14、 那些类可以用来实现TCP/IP客户服务器程序? A. ServerSocket