Java 程式設計入門 - csie.ntu.edu.twr92045/csieTrain/java2005-128/...Dept. of Computer Science...

15
Java 程式設計入門 講師:陳昭源 CSIE, NTU August 24, 2005

Transcript of Java 程式設計入門 - csie.ntu.edu.twr92045/csieTrain/java2005-128/...Dept. of Computer Science...

Java 程式設計入門

講師:陳昭源

CSIE, NTUAugust 24, 2005

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 2

Outline

核對資料、背景調查

課程介紹

Java 介紹與程式開發環境Java 程式初體驗

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 3

Course Introduction上課時間

2005.08.24 ~ 2005.10.01週三、週六 19:00 – 21:30

講師:陳昭源

Email:[email protected]課程網頁

http://www.csie.ntu.edu.tw/~r92045/csieTrain/點選 2005 Java 程式設計入門(128 期) 進入可下載所有上課相關教材,作業與成績亦在此公告

討論版,提供大家互相討論與提問的空間 ☺

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 4

Course Introduction課程目的本課程由基本 Java 程式設計概念開始,循序漸進帶領學員進入 Java 語言的殿堂。課堂上將著重於基本程式設計觀念與範例練習,並給予學員適量的課後練習。藉由講師的引導,期許學員們能於課程結束後具有初步的程式撰寫能力,並能夠藉由豐富的資源自行修習進階程式設計技巧。

上課教材所有上課投影片、講義與範例皆可於課程網站下載

課程進度表依照學習情況做動態調整

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 5

Course Introduction

參考書目

Java 2 教學手冊 SDK 1.4版(Beginning Java 2 SDK 1.4 Edition),蔡明志、陳彥仲譯,碁峰出版Ivor Horton's Beginning Java 2, JDK 5 Edition, by Ivor Horton, Wrox PressThe Java Tutorial

http://java.sun.com/docs/books/tutorial

Thinking in Java, 3rd Editionhttp://www.mindview.net/Books/TIJ/

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 6

Course Introduction

成績評定

學期中每位學員必須完成課後作業練習並繳交

上課情形(缺曠課、課堂練習、…)平均分數達 70 以上將給予結業證書

作業繳交方式

作業的截止時間為公布後的下週同一節課之前,即約一個禮拜的時間可完成作業 ☺

作業以 Email 方式寄給老師,標題為「學號:HW#」,例:JN2801:HW01

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 7

Course Introduction

作業評分標準

完成作業基本項目且執行正確:80其他評分標準請參照網頁公告

作業繳交結果將公佈在網頁上

嚴禁抄襲!

關於作業

促使學員於課後能練習與複習上課所學

確認學員是否都已了解與吸收上課內容

Questions?

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 8

Java Introduction

Java 語言是一種物件導向程式語言,由 James Gosling 等工程師於 1991 年由 Sun Microsystems 開始研發,於 1995 年五月發表主要特性物件導向(Object-Oriented, OO)跨平台

Java Virtual Machine, JVMWrite once, run anywhere!... But there are still errors on number of platforms. Write once, debug everywhere!Being very successful with server-side applications

針對網路運作提供有良好的類別庫與功能

安全性、垃圾回收機制

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 9

Java Introduction

J2SE 1.4 Platform

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 10

Java Introduction

J2SE 5.0 (1.5) Platform

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 11

Java Introduction

J2SE v1.4.2 documenthttp://java.sun.com/j2se/1.4.2/docs/index.html

J2SE 5.0 documenthttp://java.sun.com/j2se/1.5.0/docs/index.html

J2SE 5.0 Overviewhttp://java.sun.com/j2se/1.5.0/docs/guide/index.html

J2SE 5.0 New Features & Enhancementshttp://java.sun.com/j2se/1.5.0/docs/relnotes/features.html

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 12

Java Introduction

Java 網路資源Java 簡介 (Wikipedia)

http://en.wikipedia.org/wiki/Java_programming_language

Java 官方首頁http://java.sun.com

Java 常見名詞解釋http://tinyurl.com/4fl29http://tinyurl.com/4muqy

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 13

Prepare for Java!

Prepare for Programming JavaInstall Java SDK

Java 2 Platform, Standard Edition (J2SE)http://java.sun.com/j2se/index.jspJ2SE v1.4.2 SDK or J2SE 5.0 SDK

Set Environment VariablesPlease refer to our course webpage.

Java API Document1.4 http://java.sun.com/j2se/1.4.2/docs/api/index.html1.5 http://java.sun.com/j2se/1.5.0/docs/api/index.html

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 14

Your First Cup of Java!

Hello World!How to Create a Java Source?

Text Editor

The Basic Elements of a Java ProgramHow to Compile?

Create a source file. xxx.javaCompile the file into a bytecode file. javac xxx.javaRun the program! java xxx

Dept. of Computer Science & Information Engineering,National Taiwan University

August 24, 2005 Page 15

Your First Cup of Java!

HW01Set up your programming environment.Write a program showing the following messages

1st line: Your Student Number, eg. JN25012nd line: Your Name, eg. 王大明3rd line: “Hello everyone!”

Please mail to the teacher your homework with the java source file and the execution screen image.Deadline: 08/27, before the class starts.