| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 905 人关注过本帖
标题:这几道题选什么?
只看楼主 加入收藏
Grace_TT
Rank: 1
等 级:新手上路
威 望:1
帖 子:324
专家分:0
注 册:2005-12-21
收藏
 问题点数:0 回复次数:10 
这几道题选什么?

1。
How can you change the current working directory using an instance of the File class called FileName?
1) FileName.chdir("DirName")
2) FileName.cd("DirName")
3) FileName.cwd("DirName")
4) The File class does not support directly changing the current directory.


2。
If you create a TextField with a constructor to set it to occupy 5 columns, what difference will it make if you use it with a proportional font (ie Times Roman) or a fixed pitch typewriter style font (Courier).

1)With a fixed font you will see 5 characters, with a proportional it will depend on the width of the characters
2)With a fixed font you will see 5 characters,with a proportional it will cause the field to expand to fit the text
3)The columns setting does not affect the number of characters displayed
4)Both will show exactly 5 characters


3。
You need to create a class that will store unique object elements. You do not need to sort these elements but they must be unique.
What interface might be most suitable to meet this need?
1)Set
2)List
3)Map
4)Vector

[此贴子已经被作者于2006-5-6 17:57:58编辑过]

搜索更多相关主题的帖子: class difference directly current 
2006-05-06 16:01
★王者至尊★
Rank: 1
等 级:新手上路
帖 子:528
专家分:0
注 册:2006-3-28
收藏
得分:0 

第一题是4)
第二题是1)
第三题是1)


------Java 爱好者,论坛小混混,学习中------
2006-05-06 17:06
Grace_TT
Rank: 1
等 级:新手上路
威 望:1
帖 子:324
专家分:0
注 册:2005-12-21
收藏
得分:0 

4。
You have created a simple Frame and overridden the paint method as follows
public void paint(Graphics g){
g.drawString("Dolly",50,10);
}
What will be the result when you attempt to compile and run the program?
1) The string "Dolly" will be displayed at the centre of the frame
2) An error at compilation complaining at the signature of the paint method
3) The lower part of the word Dolly will be seen at the top of the frame, with the top hidden.
4) The string "Dolly" will be shown at the bottom of the frame.


5.Which of the following can you perform using the File class?

1) Change the current directory
2) Return the name of the parent directory
3) Delete a file
4) Find if a file contains text or binary information


6.
You are using the GridBagLayout manager to place a series of buttons on a Frame. You want to make the size of one of the buttons bigger than the text it contains. Which of the following will allow you to do that?
1) The GridBagLayout manager does not allow you to do this
2) The setFill method of the GridBagLayout class
3) The setFill method of the GridBagConstraints class
4) The fill field of the GridBagConstraints class

7.
You are concerned that your program may attempt to use more memory than is available. To avoid this situation you want to ensure that the Java Virtual Machine will run its garbage collection just before you start a complex routine. What can you do to be certain that garbage collection will run when you want .

1) You cannot be certain when garbage collection will run
2) Use the Runtime.gc() method to force garbage collection
3) Ensure that all the variables you require to be garbage collected are set to null

4) Use the System.gc() method to force garbage collection


8.
Which of the following most closely describes a bitset collection?
1) A class that contains groups of unique sequences of bits
2) A method for flipping individual bits in instance of a primitive type
3) An array of boolean primitives that indicate zeros or ones
4) A collection for storing bits as on-off information, like a vector of bits

9.
Which of the following statements are true?
1) Methods cannot be overriden to be more private
2) Static methods cannot be overloaded
3) Private methods cannot be overloaded
4) An overloaded method cannot throw exceptions not checked in the base class

[此贴子已经被作者于2006-5-6 19:31:04编辑过]

2006-05-06 17:58
ada518618
Rank: 1
等 级:新手上路
帖 子:184
专家分:0
注 册:2006-3-27
收藏
得分:0 

我猜第4选1
为什么都是英文?
楼主,英语几级了!?
看来我今年是别想有好日子过了!


Eclipse!尽管我现在不懂祢,可是我却对你情有独钟……
2006-05-06 19:37
★王者至尊★
Rank: 1
等 级:新手上路
帖 子:528
专家分:0
注 册:2006-3-28
收藏
得分:0 
第四题 3)
第五题 2) 3)都正确
第六题 4)
第七题 1)
第八题 4)
第九题 1)

------Java 爱好者,论坛小混混,学习中------
2006-05-06 22:37
Grace_TT
Rank: 1
等 级:新手上路
威 望:1
帖 子:324
专家分:0
注 册:2005-12-21
收藏
得分:0 
第4题为什么选3呀?
2006-05-06 23:58
Grace_TT
Rank: 1
等 级:新手上路
威 望:1
帖 子:324
专家分:0
注 册:2005-12-21
收藏
得分:0 
第7题的4为什么不对?
2006-05-06 23:59
ada518618
Rank: 1
等 级:新手上路
帖 子:184
专家分:0
注 册:2006-3-27
收藏
得分:0 

我也不明白第4为什么选3!
我是用翻译来看那道题的!不过也只有那道题翻译起来还读得懂!
其他都乱七八糟!

[此贴子已经被作者于2006-5-7 0:31:28编辑过]


Eclipse!尽管我现在不懂祢,可是我却对你情有独钟……
2006-05-07 00:30
★王者至尊★
Rank: 1
等 级:新手上路
帖 子:528
专家分:0
注 册:2006-3-28
收藏
得分:0 
第四题drawString方法的参数X,Y代表的是最左边字符基线的坐标 题中由于参数Y取值为10 即从Frame顶部 到基线只有十个象素的高度 完全有可能部分字符的上部被挡起来 只有字符的下部能显示出来 和3)描述的一样


第七题 考察的是垃圾回收站 程序员永远都不可能强制回收站工作 只能通知垃圾回收站 如置对象为null 什么时候回收内存取决于系统 具有不定性

建议楼主把最基础的知识掌握好

------Java 爱好者,论坛小混混,学习中------
2006-05-07 09:47
ada518618
Rank: 1
等 级:新手上路
帖 子:184
专家分:0
注 册:2006-3-27
收藏
得分:0 

我不想再多说话了!
TMD!我都不知道该怎么说自己了!
第4是选3,可是为什么我会说选1就只能是那个时候我傻了!


Eclipse!尽管我现在不懂祢,可是我却对你情有独钟……
2006-05-07 10:42
快速回复:这几道题选什么?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023700 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved