JAVA题库:格林模拟试题二(上)(6)
文章作者 100test 发表时间 2007:03:14 17:06:13
来源 100Test.Com百考试题网
question 17)
which statements are correct about the anchor field?
1) it is a field of the gridbaglayout manager for controlling component placement
2) it is a field of the gridbagconstraints class for controlling component placement
3) a valid setting for the anchor field is gridbagconstraints.north
4) the anchor field controls the height of components added to a container
question 18)
what will happen when you attempt to compile and run the following code?
public class bground extends thread{
public static void main(string argv[]){
bground b = new bground().
b.run().
}
public void start(){
for (int i = 0. i <10. i ){
system.out.println("value of i = " i).
}
}
}
1) a compile time error indicating that no run method is defined for the thread class
2) a run time error indicating that no run method is defined for the thread class
3) clean compile and at run time the values 0 to 9 are printed out
4) clean compile but no output at runtime
question 19)
is the following statement true or false?
when using the gridbaglayout manager, each new component requires a new instance of the gridbagconstraints class.
1) true
2) false