计算机二级

第1301题

下列方法中与Applet显示无关的是( )。

第1302题

下列语句中错误的是( )。

第1303题

下列可用作switch(expression)语句参数的是( )。

第1304题

当浏览器重新返回到包含Applet的页面时调用的方法是( )。

第1305题

阅读下列代码:

public class Test{
    public static void main(String args[]){
        System.out.println((2<0)? 10:8);
    }
}

其运行结果是( )。

第1306题

阅读下列代码:

public class Arrays{
    public static void main(String[] args){
        int[] a = new int[5];
        for(int i=0;i<a.length;i++){
            a[i] = 10 + i;
        }
        for(int i=0;i<a.length;i++){
            System.out.println(a[i]);
        }
        String[] s = {"Frank","Bob","Jim"};
        for(int i=0;i<s.length;i++){
            System.out.println(s[i]);
        }
        s[2] = "Mike";
        System.out.println(s[2]);
    }
}

代码运行结果正确的是( )。

第1307题

下列方法中能够用来实现线程之间通信的是( )。

第1308题

下列关于线程的说法中,正确的是( )。

第1309题

下列概念中不包括任何实现,与存储空间没有任何关系的是( )。

第1310题

阅读下列一个支持多线程并发操作的堆栈类代码段:

public class MyStack{
    private int idx = 0;
    private int[] data = new int[8];
    public ______ void push(int i){
        data[idx] = i;
        idx ++;
    }
}

在下划线处应填入的是( )。

第1311题

阅读下列代码:

public class Test implements Runnable{
    public void run(Thread t){
        System.out.println("Running");
    }
    public static void main(String[] args){
        Thread t = new Thread(new Test());
        t.start();
    }
}

代码运行结果是( )。

第1312题

 阅读下列代码:

public class s {
    String s = "One World One Dream";
    public static void main(String args[]){
        System.out.println(s);
    }
}

其运行结果是( )。

第1313题

下列关于线程调度的叙述中,错误的是( )。

第1314题

 调用线程的下列方法,不会改变该线程在生命周期中状态的方法是( )。

第1315题

在下面附属类方法中的下划线处应填入的正确参数是( )。

public void writeData(______)throws IOException
{
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(hireDay);
    out.println( name + "|"
        + salary + "|"
        + calendar.get(Calendar.YEAR) + "|"
        + (calendar.get(Calendar.MONTH) + 1) + "|"
        + calendar.get(Calendar.DAY_OF_MONTH));
}
第1316题

 下面程序段:

boolean a = false;
boolean b = true;
boolean c = (a&&b)&&(! b);
boolean result = (a&b)&(! b);

执行完后,正确的结果是( )。

第1317题

 在匹配器(Matcher)类中,用于输入字符串与模式串比较的方法是( )。

第1318题

下列数据结构中,属于非线性结构的是( )。

第1319题

在下列链表中,能够从任意一个结点出发直接访问到所有结点的是( )。

第1320题

下列与栈结构有关联的是( )。