武汉智远软件有限责任公司.doc

武汉智远软件有限责任公司.doc

ID:51846519

大小:352.50 KB

页数:18页

时间:2020-03-16

武汉智远软件有限责任公司.doc_第1页
武汉智远软件有限责任公司.doc_第2页
武汉智远软件有限责任公司.doc_第3页
武汉智远软件有限责任公司.doc_第4页
武汉智远软件有限责任公司.doc_第5页
资源描述:

《武汉智远软件有限责任公司.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、选择题1:What will be the result of executing the following code?     // Filename; SuperclassX.java    package packageX;     public class SuperclassX    {    protected void superclassMethodX()    {    }    int superclassVarX;    }          // Filename SubclassY.

2、java    1.package packageX.packageY;    2.    3.public class SubclassY extends SuperclassX    4.{    5.SuperclassX objX = new SubclassY();    6.SubclassY objY = new SubclassY();    7.void subclassMethodY()    8.{    9.objY.superclassMethodX();    10.int i;  

3、  11.i = objY.superclassVarX;    12.}    13.}     Choices:  Whatwillbetheresultofexecutingthefollowingcode?//Filename;SuperclassX.javapackagepackageX;publicclassSuperclassX{protectedvoidsuperclassMethodX(){}intsuperclassVarX;}//FilenameSubclassY.java1.packag

4、epackageX.packageY;2.3.publicclassSubclassYextendsSuperclassX4.{5.SuperclassXobjX=newSubclassY();6.SubclassYobjY=newSubclassY();7.voidsubclassMethodY()8.{9.objY.superclassMethodX();10.inti;11.i=objY.superclassVarX;12.}13.}Choices:A.Compilationerroratline5B.C

5、ompilationerroratline9C.Runtimeexceptionatline11D.Noneofthese2:The following code is entire contents of a file called Example.java,causes precisely one error during compilation:   class SubClass extends BaseClass{   }   class BaseClass(){   String str;   pub

6、lic BaseClass(){   System.out.println(“ok”);}   public BaseClass(String s){   str=s;}}   public class Example{   public void method(){   SubClass s=new SubClass(“hello”);   BaseClass b=new BaseClass(“world”);   }   }    Which line would be cause the error?  

7、 ThefollowingcodeisentirecontentsofafilecalledExample.java,causespreciselyoneerrorduringcompilation:classSubClassextendsBaseClass{}classBaseClass(){Stringstr;publicBaseClass(){System.out.println(“ok”);}publicBaseClass(Strings){str=s;}}publicclassExample{publ

8、icvoidmethod(){SubClasss=newSubClass(“hello”);BaseClassb=newBaseClass(“world”);}}Whichlinewouldbecausetheerror?A.9B.10C.11D.123:鉴于Java的特点,它最适合的计算环境是A.并行计算环境B.分布式计算环境C.高强度计算环境D.开放式计算环境4:What will

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。