<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-TW">
		<id>https://fgchen.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SCJP_1.6%E7%89%88%E8%80%83%E9%A1%8C_193</id>
		<title>SCJP 1.6版考題 193 - 修訂歷史</title>
		<link rel="self" type="application/atom+xml" href="https://fgchen.com/wiki/index.php?action=history&amp;feed=atom&amp;title=SCJP_1.6%E7%89%88%E8%80%83%E9%A1%8C_193"/>
		<link rel="alternate" type="text/html" href="https://fgchen.com/wiki/index.php?title=SCJP_1.6%E7%89%88%E8%80%83%E9%A1%8C_193&amp;action=history"/>
		<updated>2026-04-30T23:43:49Z</updated>
		<subtitle>本 Wiki 上此頁面的修訂歷史</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>https://fgchen.com/wiki/index.php?title=SCJP_1.6%E7%89%88%E8%80%83%E9%A1%8C_193&amp;diff=1219&amp;oldid=prev</id>
		<title>Ikk：新頁面:  Given that the elements of a PriorityQueue are ordered according to natural ordering, and:  2. import java.util.*;  3. public class GetInLine{  4.   public static void main(String[] a...</title>
		<link rel="alternate" type="text/html" href="https://fgchen.com/wiki/index.php?title=SCJP_1.6%E7%89%88%E8%80%83%E9%A1%8C_193&amp;diff=1219&amp;oldid=prev"/>
				<updated>2013-03-30T00:21:53Z</updated>
		
		<summary type="html">&lt;p&gt;新頁面:  Given that the elements of a PriorityQueue are ordered according to natural ordering, and:  2. import java.util.*;  3. public class GetInLine{  4.   public static void main(String[] a...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt; Given that the elements of a PriorityQueue are ordered according to natural ordering, and:&lt;br /&gt;
 2. import java.util.*;&lt;br /&gt;
 3. public class GetInLine{&lt;br /&gt;
 4.   public static void main(String[] args){&lt;br /&gt;
 5.     PriorityQueue&amp;lt;String&amp;gt; pq = new PriorityQueue&amp;lt;String&amp;gt;();&lt;br /&gt;
 6.     pq.add(&amp;quot;banana&amp;quot;);&lt;br /&gt;
 7.     pq.add(&amp;quot;pear&amp;quot;);&lt;br /&gt;
 8.     pq.add(&amp;quot;apple&amp;quot;);&lt;br /&gt;
 9.     System.out.println(pq.poll() + &amp;quot; &amp;quot; + pq.peek());&lt;br /&gt;
 10.   }&lt;br /&gt;
 11. }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 What is the result?&lt;br /&gt;
  A. apple pear&lt;br /&gt;
  B. banana pear&lt;br /&gt;
  C. apple apple&lt;br /&gt;
  D. apple banana&lt;br /&gt;
  E. banana banana&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:medium;&amp;quot;&amp;gt;解答&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size: medium;&amp;quot;&amp;gt;Ans: D   &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:medium;&amp;quot;&amp;gt; 解說:&lt;br /&gt;
  poll  Retrieves and removes the head of this queue, or returns null if this queue is empty.&lt;br /&gt;
  peek Retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.&lt;br /&gt;
  PriorityQueue會讓加入的元素以字母順序排列&lt;br /&gt;
  (HEAD) apple banana pear&lt;br /&gt;
  poll取出apple印出，並將apple從queue移走，peed取出banana，不移出banana&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/span&amp;gt;	&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
{{SCJP 1.6版考題講解}}&lt;/div&gt;</summary>
		<author><name>Ikk</name></author>	</entry>

	</feed>