整专业资料
微信QQ群
考生网QQ群

群号:517231281

扫码加群
点击二维码加群

考生网微信公众号

微信号:zikaosw

课程试听
最新资讯

手机端访问

1、直接输入www.zikaosw.cn
2、扫描左侧二维码

登录 | 注册
登录/注册后,可享受
  • 课程免费试听
  • 试做在线题库
  • 学习提升指导
  • [主观题] 【程序填空题】以下应用程序的界面中有一个用于输入文件名的文本框对象fileName、一个用于输入 匹配字符串的文本框对象p,和一个用于输出的文本区对象text。程序运行时,用户 输入匹配字符串和文件名,程序逐行读入文件的内容,检出那些以匹配字符串开头的行并显示在文本区中。
    public void actionPerformed(ActionEvent e) {
    String s;
    if (e.getSource() = fileName) {
    try { in = new BufferedReader(new_____________);
    } catch (FileNotFoundException el) {
    System.out.print("File Not found!\n");
    }
    text.setText(null);
    try {
    while ((s = ___________) != null){
    if(s.startsWith(p.getText())) text.append(s + ’\n’);
    }
    } catch (IOException exp) { System.out.print(MFile read error!\n”);
    }
    }
    }

     纠错    

  • 助考班推荐

您可能感兴趣的试题

  • 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,点击这里,联系客服及时补充资料。