單項(xiàng)選擇題

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

題目列表

你可能感興趣的試題

微信掃碼免費(fèi)搜題