JAVA题库:格林模拟试题三(下)(8)

文章作者 100test 发表时间 2007:03:14 17:37:51
来源 100Test.Com百考试题网


question 55)

what will happen when you attempt to compile and run the following code?

public class agg{

static public long i=10.

public static void main(string argv[]){

        switch(i){

                default:

                system.out.println("no value given").

                case 1: 

                system.out.println("one").

                case 10:

                system.out.println("ten").

                case 5:

                system.out.println("five").

        }

    }

}

1) compile time error
2) output of "ten" followed by "five"
3) output of "ten"
4) compilation and run time error because of location of default


question 56)

given the following class

public class zeroprint{

public static void main(string argv[]){

        int i =0.

        //here  

        }

}

which of the following lines if placed after the comment //here will print out 0.

1) system.out.println(i ).
2) system.out.println(i 0).
3) system.out.println(i).
4) system.out.println(i--).



相关文章


MarkSpritzler的SCJD学习指导
JAVA题库:格林模拟试题三(下)(6)
SCJP考点总结及SCJP考试要点分享[3]
SCJP考点总结及SCJP考试要点分享[4]
JAVA题库:格林模拟试题三(下)(8)
技巧心得:J2ME学习札记1
JAVA题库:格林模拟试题三(下)(4)
技巧心得:J2ME学习札记2
Java基础-创建Java程序中的线程池
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛