<?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_145</id>
		<title>SCJP 1.6版考題 145 - 修訂歷史</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_145"/>
		<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_145&amp;action=history"/>
		<updated>2026-04-28T14:29:10Z</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_145&amp;diff=1274&amp;oldid=prev</id>
		<title>Ikk：新頁面:  Given that the current directory is empty/假設目前的目錄為空的,   and that the user has read and write permissions,   and the following並且使用者有讀與寫的權限...</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_145&amp;diff=1274&amp;oldid=prev"/>
				<updated>2013-03-30T03:08:13Z</updated>
		
		<summary type="html">&lt;p&gt;新頁面:  Given that the current directory is empty/假設目前的目錄為空的,   and that the user has read and write permissions,   and the following並且使用者有讀與寫的權限...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新頁面&lt;/b&gt;&lt;/p&gt;&lt;div&gt; Given that the current directory is empty/假設目前的目錄為空的, &lt;br /&gt;
 and that the user has read and write permissions, &lt;br /&gt;
 and the following並且使用者有讀與寫的權限，依下面的程式:&lt;br /&gt;
 11. import java.io.*;&lt;br /&gt;
 12. public class DOS{&lt;br /&gt;
 13.   public static void main(String[] args){&lt;br /&gt;
 14.     File dir = new File(&amp;quot;dir&amp;quot;);&lt;br /&gt;
 15.     dir.mkdir();&lt;br /&gt;
 16.     File f1 = new File(dir, &amp;quot;f1.txt&amp;quot;);&lt;br /&gt;
 17.     try{&lt;br /&gt;
 18.       f1.createNewFile();&lt;br /&gt;
 19.     }catch(IOException e){;}&lt;br /&gt;
 20.     File newDir = new File(&amp;quot;newDir&amp;quot;);&lt;br /&gt;
 21.     dir.renameTo(newDir);&lt;br /&gt;
 22.   }&lt;br /&gt;
 23. }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Which statement is true?&lt;br /&gt;
  A. Compilation fails.&lt;br /&gt;
  B. The file system has a new empty directory named dir. 該檔案系統有一個新且空的目錄-名為dir。&lt;br /&gt;
  C. The file system has a new empty directory named newDir. 該檔案系統有一個新且空的目錄-名為newDir。&lt;br /&gt;
  D. The file system has a directory named dir, containing a file f1.txt. &lt;br /&gt;
     該檔案系統有一個新且空的目錄-名為dir，並包含一個檔案f1.txt。&lt;br /&gt;
  E. The file system has a directory named newDir, containing a file f1.txt. &lt;br /&gt;
     該檔案系統有一個新且空的目錄-名為newDir，並包含一個檔案f1.txt。&lt;br /&gt;
&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: E   &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;
 上面程式流程如下：&lt;br /&gt;
   L14 建立 dir 物件，是 file 物件&lt;br /&gt;
   L15 會建立一個目錄&lt;br /&gt;
   L16 與 L18，f1 會建立一個新檔案&lt;br /&gt;
   L20 建立了一個新目錄&lt;br /&gt;
   L21 把原 dir 物件，目錄名為 dir，要變更為 newDir&lt;br /&gt;
 所以結果為 newDir 目錄中有一個f1.txt 檔案&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>