java程式設計思想 第二章 (一切都是物件)練習 2.11 練習12
阿新 • • 發佈:2018-11-28
練習12:找出HelloDate.java的第二版本,也就是那個簡單註釋文件的示例。對該檔案執行javadoc,然後通過Web瀏覽器觀看執行結果。
該程式碼在本書第35頁
程式碼為:
//:object/HelloDate.java import java.util.*; /** The first Thinking in Java example program. * Displays a string and today's date. * @author Bruce Eckel * @author www.MindView.net * @version 4.0 */ public class HelloDate { /** Entry point to class & application. * @param args array of string arguments * @throws exceptions No exceptions thrown */ public static void main(String[] args) { System.out.println("Hello,it's:"); System.out.println(new Date()); } } /*Output:(55% match) Hello,it's: Wed Oct 05 14:39:36 MDT 2005 *///:~