格林模拟试题一(下)(3)
question 37)
given the following code
import java.awt.*;public static void main(string argv){
s.setsize(300,200);
}
}
how could you set the frame surface color to pink
1)s.setbackground(color.pink);
3)s.background(pink);
question 38)
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. question 39)
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
4)both will show exactly 5 characters |||
question 40)
given the following code how could you invoke the base constructor that will print out the string "base constructor";
system.out.println("base constructor");
base(){
}
public class sup extends base{
sup s= new sup();
}
{
}
public void derived()
//three
}
1) on the line after //one put base(10);
3) on the line after //two put super(10);
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>