首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 问两道SCJP题目:) [已结贴,结贴人:zishizhilong]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-08-09 05:42:42 楼主
    第一题:
    Java code
    Given: • d is a valid, non-null Date object • df is a valid, non-null DateFormat object set to the current locale What outputs the current locales country name and the appropriate version of d’s date? A. Locale loc = Locale.getLocale(); System.out.println(loc.getDisplayCountry() + “ “+ df.format(d)); B. Locale loc = Locale.getDefault(); System.out.println(loc.getDisplayCountry() + “ “ + df.format(d)); C. Locale bc = Locale.getLocale(); System.out.println(loc.getDisplayCountry() + “ “+ df.setDateFormat(d)); D. Locale loc = Locale.getDefault(); System.out.println(loc.getDispbayCountry() + “ “+ df.setDateFormat(d));



    答案是B,这段偶比较生疏,烦高手指教

    还有:
    Java code
    Question 8 Assume that country is set for each class. Given: 10. public class Money { 11. private String country, name; 12. public getCountry() { return country; } 13.} and: 24. class Yen extends Money { 25. public String getCountry() { return super.country; } 26. } 27. 28. class Euro extends Money { 29. public String getCountry(String timeZone) { 30. return super.getCountry(); 31. } 32. } Which two are correct? (Choose two.) A. Yen returns correct values. B. Euro returns correct values. C. An exception is thrown at runtime. D. Yen and Euro both return correct values. E. Compilation fails because of an error at line 25. F. Compilation fails because of an error at line 30.


    答案是BE,为什么不是EF?
    20  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-08-09 07:55:101楼 得分:20
    第二题中的30行,实在子类中引用父类中的方法,因为父类中该方法是public类型的
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-08-09 08:58:402楼 得分:0
    该回复于2008-08-18 21:36:08被版主删除
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved