設定 EYNY 為首頁  |  加入我的最愛
伊莉討論區


休閒聊天
學術文化
感情感性
興趣交流
家庭事務
旅遊交流
飲食交流
家族門派
貼圖分享
動漫交流
音樂世界
美容打扮
潮流資訊
影視娛樂
電玩遊戲
連線遊戲
網絡遊戲
交易廣場
下載分享
BT下載區
CB下載區
電腦資訊
數碼產品
手機交流
網站事務
體育運動
時事新聞
上班一族
博彩娛樂
成人話題


 
標題: [教學] The Java Tutorial Third Edition
天晴
(Stephen)
天晴
Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9
管理員
潛水  
UID 5
精華 13
積分 31623
帖子 18775
潛水 342089 米
閱讀權限 200
註冊 2004-5-23
來自 心情車站 Heart's Station
發表於 2005-10-16 07:51 PM  資料 主頁 文集 短消息  ICQ 狀態 Yahoo!
伊莉遊戲

[教學] The Java Tutorial Third Edition

[顯示] [隱藏]
Practise Typing & Typed By Stephen Chung From  [ 訪客無法瀏覽此圖片或下載點,請先註冊或登入會員。]

Getting Started

THIS chapter gives a quick introduction to the Java technology. First, we explain what the Java platform is and what it can do. Next are step-by-step instructions on how to compile and run two simple programs on the Win32, the UNIX/Linux or the MacOS platforms. After that, we take a look at the code for the two programs, so you can see how they work. The chapter ends with questions and exercises to test and expand your knowledge, followed by a table of download instructions for the code used in this chapter.

The software development knits (SDKs) that Sun Microsystems provides include a minimal set of tools to let you run and compile your programs. Serious developers are advised to use a professional Integrated Development Environment (IDE). See Integrated Development Environments (page 540) for a list of IDEs.

About the Java Technology

Talk about Java technology seems to be everywhere, but what exactly is it? The next two sections explain how it is both a programming language and a platform.

The Java Programming Language

The Java programming language is a high-level language that can be characterized by all the following buzzwords:





能在車站遇到你, 是一種綠份, 我會好好珍惜的!!

天晴係生命上的失敗者, 正在努力改變命運中

唔希望你地跟我一樣, 所以要加油努力呀!
頂部
天晴
(Stephen)
天晴
Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9Rank: 9
管理員
潛水  
UID 5
精華 13
積分 31623
帖子 18775
潛水 342089 米
閱讀權限 200
註冊 2004-5-23
來自 心情車站 Heart's Station
發表於 2005-10-16 08:30 PM  資料 主頁 文集 短消息  ICQ 狀態 Yahoo!
伊莉遊戲

When you’re finished, the dialog box should look like Figure 5. Now click Save and exit NotePad.

Compile the Souce File
From the Start menu, select the MS-DOS Prompt (Windows 95/98) or Command Prompt (Windows NT/2000) application. When the application launches, it should look like Figure 6.

The prompt shows your current directory. When you bring up the prompt for Windows 95/98, your current directory is usually WINDOWS on your C drive (as shown in Figure 6) or WINNT for Windows NT. To compile your source code file, changes your current directory to the one in which your file is located. For example, if your source directory is java on the C drive, you would type the following command at the prompt and press Enter:
cd c:\java

Now the prompt should change to C;\java. To change to a directory on a different drive, you must type an extra command. As shown in Figure 7, to change to the java directory on the D drive, you must reenter the drive, d:.

In our example, the java directory is on the C drive. The dir command lists the files in your current directory. If your current directory is C:\java and your enter dir at the prompt, you should see your file (Figure 8).

Now You can compile. At the prompt, type the following command and press Enter:
        Javac HelloWorldApp.java
If your prompt reappears without error messages, congratulations. You have successfully compiles your program. If you encounter errors, see Error Explanation (Win32) to help you fix the problems.

The compiler has generated a Java bytecode file, HelloWorldApp.class. At the prompt, type dir to see the new file that was generated (Figure 9). Now that you have a .class file, you can run your program.

Run the program
In the same directory, enter the following command at prompt:
        Java HelloWorldApp

Figure 10 shows what you should see.

Creating Your First Applet
HelloWorldApp is an example of an application, a standalone program. Now you will create an applet called HelloWorld,  [color=blue][size=2][ [u]瀏覽完整內容請先註冊或登入會員[/u]。][/size][/color]




能在車站遇到你, 是一種綠份, 我會好好珍惜的!!

天晴係生命上的失敗者, 正在努力改變命運中

唔希望你地跟我一樣, 所以要加油努力呀!
頂部
 




當前時區 GMT+8, 現在時間是 2008-9-7 12:40 AM

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.066054 second(s), 6 queries , Gzip enabled

清除 Cookies - 聯繫我們 - 廣告查詢 [威旭代理] - 伊莉討論區 - Archiver
重要聲明:本討論區是以即時上載留言的方式運作,伊莉討論區對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。伊莉討論區有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿撰寫粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。