<?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_021</id>
		<title>SCJP 1.6版考題 021 - 修訂歷史</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_021"/>
		<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_021&amp;action=history"/>
		<updated>2026-05-23T15:01:53Z</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_021&amp;diff=1408&amp;oldid=prev</id>
		<title>Ikk：新頁面:  1. class Batman{  2.   int squares = 81;  3.   public static void main(String[] args){  4.     new Batman().go();  5.   }  6.   void go(){  7.     incr(++squares);  8.     System.out....</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_021&amp;diff=1408&amp;oldid=prev"/>
				<updated>2013-03-30T08:32:38Z</updated>
		
		<summary type="html">&lt;p&gt;新頁面:  1. class Batman{  2.   int squares = 81;  3.   public static void main(String[] args){  4.     new Batman().go();  5.   }  6.   void go(){  7.     incr(++squares);  8.     System.out....&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt; 1. class Batman{&lt;br /&gt;
 2.   int squares = 81;&lt;br /&gt;
 3.   public static void main(String[] args){&lt;br /&gt;
 4.     new Batman().go();&lt;br /&gt;
 5.   }&lt;br /&gt;
 6.   void go(){&lt;br /&gt;
 7.     incr(++squares);&lt;br /&gt;
 8.     System.out.println(squares);&lt;br /&gt;
 9.   }&lt;br /&gt;
 10. void incr(int squares){squares += 10;}&lt;br /&gt;
 11. }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 What is the result?&lt;br /&gt;
 &lt;br /&gt;
    A. 81&lt;br /&gt;
    B. 82&lt;br /&gt;
    C. 91&lt;br /&gt;
    D. 92&lt;br /&gt;
    E. Compilation fails.&lt;br /&gt;
    F. 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: B   &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;
 go方法印出的squares是Batman的squares，incr所變更的squares是本身的方法變數&lt;br /&gt;
 此是在考call by value觀念&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>