单选题

Given that c is a reference to a valid java.io.Console object, and: 11.String pw = c.readPassword("%s", "pw: "); 12.System.out.println("got " + pw); 13.String name = c.readLine("%s", "name: "); 14.System.out.println(" got ", name); If the user types fido when prompted for a password, and then responds bob when prompted for a name,what is the result?()

AAn exception is thrown at runtime

Bpw: fido got fido name: bob got bob

Cpw: got fido name: bob got bob

DCompilation fails.

正确答案

来源:www.examk.com

答案解析

相似试题
  • Given: Which code, inserted at line 4, guarantees that this program will output [1, 2]?()

    多选题查看答案

  • Given that the current directory is empty, and that the user has read and write permissions, and thefollowing: Which statement is true?()

    单选题查看答案

  • Given:   11. public void genNumbers() {   12. ArrayList numbers = new ArrayList();   13. for (int i=0; i

    单选题查看答案

  • Given a method that must ensure that its parameter is not null: What, inserted at line 12, is the appropriate way to handle a null value?()

    单选题查看答案

  • Given: Which statement is true about the class of an object that can reference the variable base?()

    单选题查看答案

  • Assuming that the serializeBanana() and the deserializeBanana() methods will correctly use Javaserialization and given: What is the result?()

    单选题查看答案

  • Given that the elements of a PriorityQueue are ordered according to natural ordering,and: What is the result?()

    单选题查看答案

  • Given that the current directory is empty, and that the user has read and write privileges to the currentdirectory, and the following: Which statement is true?()

    单选题查看答案

  • Given: Which line of code marks the earliest point that an object referenced by intObj becomes a candidate for garbage collection?()

    单选题查看答案

  • Evaluate the following SQL statements that are issued in the given order: What would be the status of the foreign key EMP_MGR_FK?()

    单选题查看答案