CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [讨论] SCJP考试试题解析二十二
mesum
超级会员
Rank: 4



UID 321006
精华 0
积分 1811
帖子 73
威望 722
ZD币 160 元
阅读权限 90
注册 2008-4-21
状态 离线
  楼主
发表于 2008-6-25 20:21  资料  个人空间  短消息  加为好友 
开发者在线

SCJP考试试题解析二十二

SCJP考试试题解析二十二


我的QQ号:2535279


www.javaedu.com.cn

What does the following paint() method draw?

  1. public void paint(Graphics g) {

  2. g.drawString(“Any question”, 10, 0);

  3. }

  A. The string “Any question?”, with its top-left corner at 10,0

  B. A little squiggle coming down from the top of the component.

  解答:B

  点评:drawString(String str, int x, int y)方法是使用当前的颜色和字符,将str的内容显示出来,并且最左的字符的基线从(x,y)开始。在本题中,y=0,所以基线位于最顶端。我们只能看到下行字母的一部分,即字母‘y’、‘q’的下半部分。




顶部
 



当前时区 GMT+8, 现在时间是 2009-7-4 16:57

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.068835 second(s), 4/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版