question 59)
what will happen when you attempt to compile and run the following codeclass base{
private void amethod(int ibase){
system.out.println("base.amethod");
}
}
class over extends base{
public static void main(string argv[]){
over o = new over();
int ibase=0;
o.amethod(ibase);
}
public void amethod(int iover){
system.out.println("over.amethod");
}
}
1) compile time error complaining that base.amethod is private
2) runtime error complaining that base.amethod is private
3) output of "base.amethod"
4) output of "over.amethod"
question 60)
you are creating an applet with a frame that contains buttons. you are using the gridbaglayout manager and you have added four buttons. at the moment the buttons appear in the centre of the frame from left to right. you want them to appear one on top of the other going down the screen. what is the most appropriate way to do this.
1) set the gridy value of the gridbagconstraints class to a value increasing from 1 to 4
2) set the fill value of the gridbagconstraints class to vertical
3) set the ipady value of the gridbagconstraints class to a value increasing from 0 to 4
4) set the fill value of the gridbaglayouts class to gridbag.vertical
来源:考试大-Java认证
责编:yunyun 评论 纠错
2下一页