- 相关推荐
2016年Sun认证重点试题
Sun公司推出了Java以及Solaris技术认证方案。对于企业而言,可以借助这项认证作为招聘人才的评判标准,或是作为衡量员工技术水准的依据;在个人方面,通过这些认证也可以证明个人的技术能力。下面是最新的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)
{
System.out.print(ch);
return true;
}
}
2.写出此程序的输出结果.
class Demo
{
public static void main(String[] args)
{
int a=3,b=8;
int c=(a>b)?a++:b++;
System.out.println("a="+a+"\tb="+b+"\tc+"+c);
int d=(a>b)?++a:++b;
System.out.println("a="+a+"\tb="+b+"\tc+"+d);
int e=(a
System.out.println("a="+a+"\tb="+b+"\tc+"+e);
int f=(a
System.out.println("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;
}
System.out.println("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)
{
System.out.print("A ");
x++;
break wx;
}
System.out.print("B ");
x++;
}
System.out.print("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;
}
System.out.println("i="+i);
}
}
【Sun认证重点试题】相关文章:
sun认证java基础模拟试题09-16
sun java认证考试题库09-04
关于SUN认证的作用08-19
SUN认证基本知识09-01
SUN推出netbeans专家认证01-25
Sun java认证考试答案10-23
Sun-Java程序员认证考试题库10-26
sun认证java关于字符串处理技巧08-26
ACCD认证 Photoshop 试题10-30
adobe photoshop 认证试题08-29