Test of the Java Skill(4)

艾瑞手机靓号

艾瑞手机靓号

2016-02-19 18:39

岁数大了,QQ也不闪了,微信也不响了,电话也不来了,但是图老师依旧坚持为大家推荐最精彩的内容,下面为大家精心准备的Test of the Java Skill(4),希望大家看完后能赶快学习起来。


     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”
  
     Question 28:
     What will happen when you attempt to compile and run the following code?
     public class StrEq{
     public static void main(String argv[]){
     StrEq s = new StrEq();
     }
     private StrEq(){
     String s = “Marcus”;
     String s2 = new String(“Marcus”);
     if (s==s2){
     System.out.println(“we have a match”);
     }else{
     System.out.println(“Not equal”);
     }
     }
     }
  
     A. Compile time error caused by private constrUCtor
  
     B. Output of “we have a match”
  
     C. Output of “Not equal”
  
     D. Compile time error by attempting to compare string using ==
  

展开更多 50%)
分享

猜你喜欢

Test of the Java Skill(4)

编程语言 网络编程
Test of the Java Skill(4)

Test of the Java Skill(1)

编程语言 网络编程
Test of the Java Skill(1)

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

Test of the Java Skill(2)

编程语言 网络编程
Test of the Java Skill(2)

java_util_test

编程语言 网络编程
java_util_test

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

正则匹配的test函数

Web开发
正则匹配的test函数

Java入门(4) 第一个Java程序

编程语言 网络编程
Java入门(4) 第一个Java程序

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

win7右下角的小喇叭不能调节声音怎么办

win7右下角的小喇叭不能调节声音怎么办

写Java程序最容易犯的21种错误

写Java程序最容易犯的21种错误
下拉加载更多内容 ↓