JAVA题库:格林模拟试题三(下)(3)
文章作者 100test 发表时间 2007:03:14 17:38:06
来源 100Test.Com百考试题网
question 38)
which of the following statements are true?
1) code must be written if the programmer wants a frame to close on 0selecting the system close menu
2) the default layout for a frame is the borderlayout manager
3) the layout manager for a frame cannot be changed once it has been assigned
4) the gridbaglayout manager makes extensive use of the the gridbagconstraints class.
question 39)
given the following class definition
public class droitwich{
class one{
private class two{
public void main(){
system.out.println("two").
}
}
}
}
which of the following statements are true
1) the code will not compile because the classes are nested to more than one level
2) the code will not compile because class two is marked as private
3) the code will compile and output the string two at runtime
4) the code will compile without error
question 40)
given the following code
class base{
static int oak=99.
}
public class doverdale extends base{
public static void main(string argv[]){
doverdale d = new doverdale().
d.amethod().
}
public void amethod(){
//here
}
}
which of the following if placed after the comment //here, will compile and modify the value of the variable oak?
1) super.oak=1.
2) oak=33.
3) base.oak=22.
4) oak=50.1.