Sun认证重点试题

时间:2023-03-27 04:47:13 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)

  {

  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国际认证09-04

sun认证:java程序设计考试试题08-20

SUN-Java认证考试题库05-19

SUN认证考试科目06-03

SUN认证考试项目06-03

sun认证报考指南08-27

SUN认证考试流程06-10

sun认证考试的作用05-29

Sun认证考试类型05-29

sun java认证报考指南08-26