纠错
全专业资料、题库、学位、网课
最高直省2344元
上千+科次精品网课
买网课即送全真模考题库
五千+科次教材资料
电子资料满三件9折
五千+科次在线题库
全真呈现历年考试试题
1、[填空题]File Writer类的作用是为______提供支持。
2、[主观题]【程序分析题】阅读下列程序,请写出该程序的输出结果。
public class Test35{
public static void main(String[] args) { System.out.println("开始:");
MyThread x = new MyThread(1000, MyThread y = new MyThread(300, "boy"); x.start();
y.start();
while (x.isAlive() || y.isAlive〇); System.out_println("结束•");
}
class MyThread extends Thread { int dt;
String name;
public MyThread(int c, String n) { dt = c;
name = n;
}
public void run() {
MyResourceClass.outMsg(this);
}
class MyResourceClass {
synchronized static void outMsg(MyThread th){
System.out.println(th.name + " "+”启动 for (int i = 0; i < 2; i-H-) {
System.out.println(th.name + "第"+i+"次活动•"); try {
Thread.sleep(th.dt);
} catch (InterruptedException e) { }
}
System.out.println(th.name + " 活动完成.");
3、[主观题]【程序分析题】.阅读下列程序段,请写出标有注解(1)、(2)和(3)语句的作用。
Image img[];
public void int(){
img=new Image[15];
for (int i=0;i<15;i++){
img[i]=getImage(getCodeBase(),’’img"+i+".jpg"); // (1)
}
public void paint(Graphics g){ int i=0, k=0;
while(k<15000){;//语句略
g.drawlmage(img[i],0,0,this); //(2)
k++;
for(intj=0;j<5000000;j++){} //(3)
i = (i+1)% img.length;
}
}
4、[主观题]【简答题】请写出表达式实现以下功能:变量y的值为5与变量z的值为3,有且只有一t成立。
5、[主观题]【简答题】请写出Graphics2D类中stroke、paint两种属性的作用。www.zi kaosw.com
Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.
温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。