sun公司名称的由来很多人不知道,它其实是斯坦福大学校园网(Stanford University Network)的首字母缩写。yjbys小编收集一些Sun_Java程序员认证考试题库,希望大家认真阅读!
1.下列哪项不属于Java语言的'基本数据类型?
ng
le
ean
2.下列哪项不是int类型的字面量?
A.u03A6
B.077
BC
D.20
3.下列哪项不是有效的标识符?
Name
B.2test
C.$change
D._password
4.下列哪项是Java语言中所规定的注释样式?(选三项)
A.//单行注释
B.--单行注释
C. /*
*单行或多行注释
*/
D. /kk
*文档注释
*/
5.下列哪项不是Java语言的关键字?
of
anceof
tile
6.现有如下五个声明:
Linel: int a_really_really_really_long_variable_name=5 ;
Line2: int _hi=6;
Line3: int big=Integer. getlnteger("7”);
Line4:int $dollars=8;
line5: int %opercent=9;
哪行无法通过编译?
1
3
C. Line4
D. Line5
7.现有:
1. class Top {
2. static int x=l;
3. public Top (inty) { x*=3; }
4. }
5. class Middle extends Top {
6. public Middle() {x+=1; )
7. public static void main (String [] args) {
8. Middle m = new Middle();
9. System. out tln (x);
IO. }
II. }
结果为:
A.1
B. 2
C.3
D.编译失败
8.现有:
1. class Passer f
2. static final int X=5;
ic static void main (String [] args) {
4. new Passer() (x);
em. out t (x);
6, )
7. void go (int x) {
em. out t(x++);
9. }
10. }
结果是什么?
A.55
B.56
C.65
D.66
9.现有:
1. class Wrench f
ic static void main(String [] args) {
ch w=new Wrench(); Wrench w2=new Wrench();
4. w2=go (w, w2);
t (w2==w);
6. }
ic Wrench go (Wrench wrl, Wrench wr2) {
ch wr3=wrl; wrl=wr2; wr2=wr3;
9. return wr3;
10. }
11. }
结果是什么?
A. false
B. true
C.编译失败
D.运行的时候有异常抛出
10.现有:
5. class Wrench2 {
6. int size;
ic static void main(String [] args) {
ch2 w=new Wrench2();
9. =II;
IO. Wrench2 w2=go(w, );
II. System. out t (w2. size);
12. )
13. static Wrench2 go(Wrench2 wr. int s) {
14. S=12;
15。 return wr;
16. }
17. }
结果为:
A. 11
B. 12
c.编译失败。
D.运行时异常被抛出