| 网站首页 | 文章 | 下载 | 图库 | 留言 | 论坛 | 邮箱 | 黑客商城 | 资源 | 博客 | 会员区 | 黑客动画 | 视频资源 | 经典收集 | 
免费服务 发表文章 在线破解 黑客游戏 精华收集 电影频道 音乐频道 二级域名 免费代理 免费 FTP 交换资源
收费服务 黑客培训 光盘刻录 黑客书籍 视频下载 主力频道 空间域名 网站建设 特色服务 解决方案 我要投诉
您现在的位置: 华夏黑客同盟 >> 经典收集 >> 认证考试 >> JAVA认证 >> 培训资源 >> 收集正文 用户登录 新用户注册
Test of the Java Skill(4)            【字体:
Test of the Java Skill(4)
作者:佚名 文章来源:不详 点击数: 更新时间:2005-12-23
   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 ==

   Question 29:
   Which of the following will compile correctly?

   A. short myshort = 99S;

   B. String name = ‘Excellent tutorial Mr Green';

   C. char c = 17c;

   D. int z = 015;
   Question 30:
   Which of the following are benefits of encapsulation?

   A. All variables can be manipulated as Objects instead of primitives

   B. By making all variables protected they are protected from accidental corruption

   C. The implementation of a class can be changed without breaking code that uses it

   D. making all methods protected prevents accidental corruption of data

   Question 31:
   Given the following classes which of the following will compile without error?

   interface IFace{}
   class CFace implements IFace{}
   class Base{}

   public class ObRef extends Base{
   public static void main(String argv[]){
   ObRef ob = new ObRef();
   Base b = new Base();
   Object o1 = new Object();
   IFace o2 = new CFace();
   }
   }

   A. o1 = o2;

   B. b = ob;

   C. ob = b;

   D. o1 = b;
   Question 32:
   Your chief software designer has shown you a sketch of the new Computer parts system she is about to create. At the top of the hierarchy is a Class called Computer and under this are two child classes. One is called LinuxPC and one is called WindowsPC. The main difference between the two is that one runs the Linux OS and the other runs the Windows OS (of course another difference is that one needs constant re-booting and the other runs reliably). Under the WindowsPC are two Sub classes one called Server and one Called Workstation. How might you appraise your designers work?

   A. Give the go ahead for further design using the current scheme

   B. Ask for a re-design of the hierarchy with changing the OS to a field rather than Class type

   C. Ask for the option of WindowsPC to be removed as it will soon be obsolete
D. Change the hierarchy to remove the need for the superfluous Computer Class(CN-JAVA)

收集录入:华夏    责任编辑:华夏 
  • 上一篇收集:

  • 下一篇收集:
  • (只显示最新5条。评论内容只代表网友观点,与本站立场无关!)
    最新热点资讯
    最新推荐资讯
    相关收集
  • Java程序员认证模拟题及详细分析…

  • Java程序员认证模拟题及详细分析…

  • Java程序员认证模拟题及详细分析…

  • Java程序员认证模拟题及详细分析…

  • SUN认证Java2程序员考试(SCJP) 试…

  • JAVA图形设计卷I AWT 第一章绪论

  • SCJP考试心得

  • SUN认证JAVA程序员考试大纲

  • 答疑解惑:一道SCJP考题

  • Test of the Java Skill(3)

  • 最新推荐软件
    最新推荐视频
    最新推荐动画

    Copyright @ 2005 77169.Net Inc. All rights reserved. 华夏黑客同盟 版权所有
    北京市电信通提供网络带宽

    mailto:webmaster@77169.net
    咨询QQ号:836982 / 59280880
    联系站长 有事给站长留言!
    热线电话: 86-10-63643422/63643423
    京ICP证041431号