<?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_142</id>
		<title>SCJP 1.6版考題 142 - 修訂歷史</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_142"/>
		<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_142&amp;action=history"/>
		<updated>2026-05-04T09:10:45Z</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_142&amp;diff=1277&amp;oldid=prev</id>
		<title>Ikk：新頁面:  Assuming that the serializeBanana() and the deserializeBanana()  methods will correctly use Java serialization and given:  13. import java.io.*;  14. class Food implements Serializabl...</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_142&amp;diff=1277&amp;oldid=prev"/>
				<updated>2013-03-30T03:12:12Z</updated>
		
		<summary type="html">&lt;p&gt;新頁面:  Assuming that the serializeBanana() and the deserializeBanana()  methods will correctly use Java serialization and given:  13. import java.io.*;  14. class Food implements Serializabl...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt; Assuming that the serializeBanana() and the deserializeBanana()&lt;br /&gt;
 methods will correctly use Java serialization and given:&lt;br /&gt;
 13. import java.io.*;&lt;br /&gt;
 14. class Food implements Serializable{int good = 3;}&lt;br /&gt;
 15. class Fruit extends Food{int juice = 5;}&lt;br /&gt;
 16. public class Banana extends Fruit{&lt;br /&gt;
 17.   int yellow = 4;&lt;br /&gt;
 18.   public static void main(String[] args) {&lt;br /&gt;
 19.     Banana b = new Banana(); Banana b2 = new Banana();&lt;br /&gt;
 20.     b.serializeBanana(b); //assume correct serialization&lt;br /&gt;
 21.     b2 = b.deserializeBanana(); //assume correct&lt;br /&gt;
 22.     System.out.println(&amp;quot;restore &amp;quot; + b2.yellow + b2.juice + b2.good);&lt;br /&gt;
 24.   }&lt;br /&gt;
 25. //more Banana methods go here&lt;br /&gt;
 50. }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 What is the result?&lt;br /&gt;
  A. restore 400&lt;br /&gt;
  B. restore 403&lt;br /&gt;
  C. restore 453&lt;br /&gt;
  D. Compilation fails.&lt;br /&gt;
  E. An exception is thrown at runtime.&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: C   &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;
物件的串流操作，serialize和deserialize可看做是將物件放入或取出一個磁帶&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>