SUN認證

當前位置 /首頁/IT認證/SUN認證/列表

2016年Sun認證重點試題

Sun公司推出了Java以及Solaris技術認證方案。對於企業而言,可以藉助這項認證作為招聘人才的`評判標準,或是作為衡量員工技術水準的依據;在個人方面,通過這些認證也可以證明個人的技術能力。下面是最新的sun認證考試題及答案,希望能幫助到大家!

2016年Sun認證重點試題

1.寫出此程式的輸出結果.

class Test_For

{

public static void main(String[] args)

{

int i=0;

for(show('A'); show('B')&&(i<2);show('C'))

{

i++;

show('D');

}

}

public static boolean show(char ch)

{

t(ch);

return true;

}

}

2.寫出此程式的輸出結果.

class Demo

{

public static void main(String[] args)

{

int a=3,b=8;

int c=(a>b)?a++:b++;

tln("a="+a+"tb="+b+"tc+"+c);

int d=(a>b)?++a:++b;

tln("a="+a+"tb="+b+"tc+"+d);

int e=(a

tln("a="+a+"tb="+b+"tc+"+e);

int f=(a

tln("a="+a+"tb="+b+"tc+"+f);

}

}

3.寫出此程式的輸出結果.

class Demo

{

public static void main(String []args)

{

int i = 0, j = 5;

tp: for (;;)

{

i++;

for(;;)

if(i > j--) break tp;

}

tln("i = " + i + ", j = "+ j);

}

}

4.寫出此程式的輸出結果.

class DemoWhile_3

{

public static void main(String[] args)

{

int x=1;

while(x<10)

{

wx:while(x<7)

{

while(x<4)

{

t("A ");

x++;

break wx;

}

t("B ");

x++;

}

t("C ");

x++;

}

}

}

5.選擇正確答案:

class Test

{

public static void main(String[] args)

{

String foo=args[1];

String bar=args[2];

String baz=args[3];

}

}

d:>java Test Red Green Blue

what is the value of baz?

A. baz has value of ""

B. baz has value of null

C. baz has value of "Red"

D. baz has value of "Blue"

E. baz has value of "Green"

F. the code does not compile

G. the program throw an exception

6.寫出輸出結果.

class Demo

{

public static void main(String[] args)

{

show(0);

show(1);

}

public static void show(int i)

{

switch(i)

{

default:

i+=2;

case 1:

i+=1;

case 4:

i+=8;

case 2:

i+=4;

}

tln("i="+i);

}

}

TAG標籤:試題 Sun #