|
谋学网www.mouxue.com
一、单选题(共 20 道试题,共 100 分。)
V 1. 编译并运行以下程序(命令:jv Testlss 0),关于运行结果的描述以下哪个选项是正确的( ) lss Testlss{ puli stti voi min(String [ ] rgs){ long i=0; try{ i=Integer.prseInt(rgs[0]); }th(Exeption e){ } swith(i) {se 0: System.out.
. 编译出错
. 打印出"0"
. 打印出"1"
. 打印出"efult"
标准资料:
2. 以下声明合法的是( )
. efult String s
. puli finl stti ntive int w( )
. strt oule ;
. strt finl oule hyperoliosine( )
标准资料:
3. 类Test1定义如下: puli lss Test1{ puli flot Metho(flot ,flot ){ } } 将以下哪种方法插入行3是不合法的。( )
. puli flot Metho(flot , flot ,flot ){ }
. puli flot Metho(flot ,flot ){ }
. puli int Metho(int , int ){ }
. privte flot Metho(int ,int ,int ){ }
标准资料:
4. 关于以下程序段,正确的说法是( ) String s1=""+"ef"; String s2=new String(s1); if(s1= =s2) System.out.println("= = sueee"); if (s1.equls(s2)) System.out.println(".equls() sueee");
. 行4与行6都将执行
. 行4执行,行6不执行
. 行6执行,行4不执行
. 行4、行6都不执行
标准资料:
5. 以下哪项可能包含菜单条()
. Pnel
. Frme
. pplet
. ilog
标准资料:
6. 以下代码完成画线功能,指出所画线的颜色()g.setolor(olor.re.green.yello.yn); g.rwLine(0,0,100,100);
. re
. green
. yello
. yn
标准资料:
7. 类Test1定义如下: puli lss Test1{puli flot Metho(flot ,flot ){ } }将以下哪种方法插入行3是不合法的。( )
. puli flot Metho(flot , flot ,flot ){ }
. puli flot Metho(flot ,flot ){ }
. puli int Metho(int , int ){ }
. privte flot Metho(int ,int ,int ){ }
标准资料:
8. 执行完以下代码int [ ]x = new int[25];后,以下哪项说明是正确的( )
. x[24]为0
. x[24]未定义
. x[25]为0
. x[0]为空
标准资料:
9. 通过调用 new List(10,flse)创建一个列表,关于该列表的几个说法哪项是错误的。( )
. 该列表不支持复选
. 该列表有10个选项
. 根据需要该列表可能有垂直滚动条
. 该列表支持10个可见选项
标准资料:
10. 以下代码段执行后的输出结果为( )int x=3; int y=10; System.out.println(y%x);
. 0
. 1
. 2
. 3
标准资料:
11. 以下代码段执行后的输出结果为()int x=3; int y=10; System.out.println(y%x);
. 0
. 1
. 2
. 3
标准资料:
12. 下列关于修饰符混用的说法,错误的是( )
. strt不能与finl并列修饰同一个类
. strt类中不可以有privte的成员
. strt方法必须在strt类中
. sti方法中能处理非stti的属性
标准资料:
13. 编译运行以下程序后,关于输出结果的说明正确的是 ( ) puli lss onitionl{ puli stti voi min(String rgs[ ]){ int x=1; System.out.println("vlue is "+ ((x<1)? 1.0 : 0)) ; } }
. 输出结果为:vlue is 1.0
. 输出结果为:vlue is 0
. 输出结果为:vlue is 0.0
. 编译错误
标准资料:
14. 通过调用 new List(10,flse)创建一个列表,关于该列表的几个说法哪项是错误的。( )
. 该列表不支持复选
. 该列表有10个选项
. 根据需要该列表可能有垂直滚动条
. 该列表支持10个可见选项
标准资料:
15. 5、编译运行以下程序后,关于输出结果的说明正确的是 ( ) puli lss onitionl{ puli stti voi min(String rgs[ ]){ int x=4; System.out.println("vlue is "+ ((x>4) ? 99.9 :9)); }}
. 输出结果为:vlue is 99.99
. 输出结果为:vlue is 9
. 输出结果为:vlue is 9.0
. 编译错误
标准资料:
16. 以下说法哪项是正确的( ) 1.lss MyListener 2. extens Mousepter implements MouseListener{ 3. puli voi mouseEntere(MouseEvent mev) 4. { System.out.println("Mouse entere."); } 5.}
. 以上代码可通过编译
. 不能通过编译,因为没有实现MouseListener接口中的所有方法
. 不能通过编译,因为类头定义不能分行
. 能通过编译,但是若组件用该类作为Mouse事件的监听者并且接收了mouse-exite事件,则在执行过程中会抛出异常
标准资料:
17. 关于被私有访问控制符privte修饰的成员变量,以下说法正确的是( )
. 可以被三种类所引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类
. 可以被两种类访问和引用:该类本身、该类的所有子类
. 只能被该类自身所访问和修改
. 只能被同一个包中的类访问
标准资料:
18. 以下说法哪项是正确的( )lss MyListener extens Mousepter implements MouseListener{ puli voi mouseEntere(MouseEvent mev) {System.out.println("Mouse entere."); } }
. 以上代码可通过编译
. 不能通过编译,因为没有实现MouseListener接口中的所有方法
. 不能通过编译,因为类头定义不能分行
. 能通过编译,若组件用该类作为Mouse的监听者并且接收了mouse-exite事件,则在执行过程中会抛出异常
标准资料:
19. 以下选项中循环结构合法的是()
. while (int i<7) { i++; System.out.println("i is "+i); }
. int j=3; while(j) { System.out.println(" j is "+j); }
. int j=0; for(int k=0; j + k !=10; j++,k++) { System.out.println(" j is "+ j + "k is"+ k); }
. int j=0; o{ Syst
标准资料:
20. 以下哪个表达式是不合法的( )
. String x="Hello"; int y=9; x+=y;
. String x="Hello"; int y=9; if(x= =y) { }
. String x="Hello"; int y=9; x=x+y;
. String x=null; int y=(x!=null)&&(x.length()>0) ? x.length : 0
标准资料:
|
|