2017年Sun-Java程序員認證考試題庫

sun公司名稱的由來很多人不知道,它其實是斯坦福大學校園網(Stanford University Network)的首字母縮寫。yjbys小編收集一些Sun_Java程序員認證考試題庫,希望大家認真閱讀!

2017年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.運行時異常被拋出