black

SCJP程序员认证考试

登录

单项选择题

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

相关考题

单项选择题 1. import java.util.*;  2. public class Example {  3. public static void main(String[] args) {  4. // insert code here  5. set.add(new integer(2));  6. set.add(new integer(l));  7. System.out.println(set);  8. }  9. }  Which code, inserted at line 4, guarantees that this program will output [1,2]? ()

多项选择题 10. interface Jumper { public void jump(); }  ......  20. class Animal {}  ......  30. class Dog extends Animal { 31. Tail tail; 32. }  ......  40. class Beagle extends Dog implements Jumper {  41. public void jump() { }  42. }  .......  50. class Cat implements Jumper {  51. public void jump() { }  52. }  Which three are true?()

多项选择题 Whichtwoaretrueabouthas-aandis-arelationships?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3