JAVA题库:格林模拟试题一(下)(8)

来源:java认证发布时间:2012-11-12 12:47:16java认证视频

 

question 55)

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 collectionx2s

question 56)

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 

question 57)

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

question 58)
you have these files in the same directory. what will happen when you attempt to compile and run class1.java if you have not already compiled base.java

//base.java
package base;
class base{
protected void amethod(){
system.out.println("amethod");
}//end of amethod
}//end of class base
package class1;
//class1.java
public class class1 extends base{
public static void main(string argv[]){
base b = new base();
b.amethod();
}//end of main

}//end of class1




1) compile error: methods in base not found
2) compile error: unable to access protected method in base class
3) compilation followed by the output "amethod"
4)compile error: superclass class1.base of class class1.class1 not found

上一页12下一页

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答