SUN认证 百分网手机站

Sun认证重点试题

时间:2018-03-17 10:21:38 SUN认证 我要投稿

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);

  }

  }

【2016年Sun认证重点试题】相关文章:

1.SUN国际认证试题及答案

2.sun公司国际认证试题及答案

3.Sun国际认证

4.关于SUN认证的作用

5.SUN认证基本知识

6.sun认证报考指南

7.SUN JAVA认证介绍

8.SUN认证考试面试题