易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

5. String foo = “base”;   6. foo.substring(0,3);   7. foo.concat(“ket”)  8.   Type the value of foo at line 8.()

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • What is wrong with the following code?()   class MyException extends Exception {}   public class Qb4ab {   public void foo() {  try {  bar();  } finally {  baz();   } catch (MyException e) {}  }   public void bar() throws MyException {   throw new MyException();  }   public void baz() throws RuntimeException {   throw new RuntimeException();   }   }  

    A、Since the method foo() does not catch the exception generated by the method baz(), it must declare the RuntimeException in its throws clause.

    B、A try block cannot be followed by both a catch and a finally block.

    C、An empty catch block is not allowed.

    D、A catch block cannot follow a finally block.

    E、A finally block must always follow one or more catch blocks.

  • import java.util.*;  public class PQ {  public static void main(String[] args) {  PriorityQueue pq = new PriorityQueue();  pq.add(”carrot”); pq.add(”apple”);  pq.add(”banana”);  System.out.println(pq.poll() +”:” + pq.peek()); }  }  What is the result?() 

    A、 apple:apple

    B、 carrot:apple

    C、 apple:banana

    D、 banana:apple

    E、 carrot:carrot

    F、 carrot:banana

  • Which three are valid?()

    A

    p0=p1;

    B

    p1=p2,

    C

    p2=p4;

    D

    p2=(ClassC)p1;

    E

    p1=(ClassB)p3;

    F

    p2=(ClassC)p4;

  • What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?()  

    A、The particular event instance.

    B、The source of the event.

    C、The set of events that were triggered by the same action.

    D、The type of event.

    E、The type of component from which the event originated.

  •  public class Foo implements Runnable (   public void run (Thread t) {   system.out.printIn(“Running.”);   }   public static void main (String args) {   new thread (new Foo()).start();   }   )   What is the result?()  

    A、 An exception is thrown.

    B、 The program exists without printing anything.

    C、 An error at line 1 causes compilation to fail.

    D、 An error at line 2 causes the compilation to fail.

    E、 “Running” is printed and the program exits.

联系客服 会员中心
TOP