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

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
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
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
快速回复:这几道题选什么?
数据加载中...
 
   



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

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