全部知识点

第5741题

类Test的定义如下,则下划线处不能填入的是( )。

public class Test{
    public float testFun(int a,float b){
    }
}
第5742题

用来从字符输入流中读取并缓冲字符的类是( )。

第5743题

 Java对象流的输出类是( )。

第5744题

下列可以注册窗口监听器的方法是( )。

第5745题

下列选项中,属于Java接口的是( )。

第5746题

 下列代码中的键盘适配器是( )。

public class MyKey extends KeyAdapter {
    public void keyPressed(KeyEvent e) {}
    public void keyReleased(KeyEvent e) {}
    public void keyTyped(KeyEvent e) {}
}
第5747题

 JFrame的默认布局管理器是( )。

第5748题

下列程序的执行结果是( )。

public class ExceptionTest {
    public static void main(String []args) {
        String[] data = {"1", "2.5"};
        int sum = 0;
        for(int i = 1; i <= 2; i++) {
            try {
                sum = sum + Integer.parseInt(data[i]);
            } catch(NumberFormatException f) {
                System.out.println("*");
            } catch(Exception e) {
                System.out.println("#");
            } finally {
                System.out.println("end");
            }
        }
    }
}
第5749题

 下列关于Java线程的说法中,错误的是( )。

第5750题

下列关于TryThread类的定义中,正确的是( )。

第5751题

若线程执行语句synchronized(this)没有成功,则该线程将进入的状态是( )。

第5752题

当使用Counter Thread=new Counter()创建一个线程cThread时,下列关于Counter类的说法中,正确的是( )。

第5753题

下列程序向JApplet中增加了一个按钮,横线处应填入的正确代码是( )。

import javax.swing.*;
import java.awt.*;
public class SwingApplet extends JApplet {
    JButton b = new JButton("Begin");
    public void init() {
        Container contentPane = ______;
        contentPane.add(b);
    }
}

第5754题

下列Simple类定义的方法中,属于Applet生命周期方法的是( )。

import java.applet.Applet;
import java.awt.Graphics;
public class Simple extends Applet {
    Stringbuffer buffer = new StringBuffer();
    public void start() {
        addItem("starting...");
    }
    public void stop() {
        addItem("stopping...");
    }
    void addItem(String newWord) {
        ……
    }
    public void paint(Graphics g) {
        g.drawRect(0,0,size().width - 1,size().height - 1);
        g.drawString(buffer.toString(),5,15);
    }
}


第5755题

下列类中,不允许存储重复对象的是( )。

第5756题

给出下面程序:

if(x>0) {System.out.println("Hello");}
else if (x> -3) {System.out.println("Nice to meet you");}
else {System.out.println("How are you");}

若打印字符串“How are you?”,则x的取值范围是( )。

第5757题

下列关于Java Application与Applet的说法中,正确的是( )。

第5758题

下列代码中,将引起一个编译错误的行是( )。

1) public class Test{

2)     int m,n;

3)     public Test() {}

4)     public Test(int a) { m = a; }

5)     public static void main(String args[]){

6)         Test t1,t2;

7)         int j,k;

8)         j = 0;k = 0;

9)         t1 = new Test();

10)        t2 = new Test(j,k);

第5759题

 在Java中,负责对字节代码解释执行的是( )。

第5760题

 下列叙述中,正确的是( )。