JAVA模拟题:TestoftheJavaSkill(4)

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


  Question 25:
   What will happen when you attempt to compile and run the following code?

   int Output = 10.
   boolean b1 = false.
   if ((b1==true)&.&.((Output =10)==20)){
   System.out.println(“We are equal “ Output).
   }
   else{
   System.out.println(“Not equal!” Output).
   }

   A. Compile error, attempting to perform binary comparison on logical data type

   B. Compilation and output of “We are equal 10”

   C. Compilation and output of “Not equal! 20”

   D. Compilation and output of “Not equal! 10”

   Question 26:
   Which of the following are true?

   A. Java uses a time-slicing scheduling system for determining which Thread will execute.

   B. Java uses a pre-emptive, co-operative system for determining which Thread will execute.

   C. Java scheduling is platform dependent and may vary from one implementation to another.

   D. You can set the priority of a Thread in code.
  Question 27:
   What will happen when you attempt to compile and run the following code?

   public class MySwitch{
   public static void main(String argv[]){
   MySwitch ms = new MySwitch().
   ms.amethod().
   }
   public void amethod(){
   int k=10.
   switch(k){
   default:
   System.out.println(“This is the default output”).
   break.
   case 10:
   System.out.println(“ten”).
   case 20:
   System.out.println(“twenty”).
   break.
   }
   }
   }

   A. None of these options

   B. Compile time error target of switch must be an integral type

   C. Compile and run with output “This is the default output”

   D. Compile and run with output “ten”


相关文章


JavaSE6.0桌面API编程 (中)
JAVA基础:利用Java实现zip压缩解压缩
JavaSE6.0桌面API编程 (上)
JAVA模拟题:TestoftheJavaSkill(3)
JAVA模拟题:TestoftheJavaSkill(4)
JAVA基础:语言中链表和双向链表的实现(2)
全程追踪入侵JSP网站服务器
JavaSE6.0桌面API编程 (下)
JAVA练习题:答疑解惑一道SCJP考题
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛