Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute.

Similar presentations


Presentation on theme: "Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute."— Presentation transcript:

1

2 Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology

3 Java -- A very Hot Object- Oriented Language Goals: Learning Java Programming & Understanding Java and Java Technology

4 自我介紹 幼稚園 : 彰化 縣 溪湖糖廠幼稚園 小學 : 基隆市成功國小 國中 : 高雄縣旗山國中 高中 : 台南一中 大學 : 台中市東海大學資訊科學 研究所 : 台北市大同工學院資訊工程 當兵 : 花蓮八零五醫院少尉資訊官 留學 : 美國紐約市哥倫比亞大學資訊科學

5 Outline Why Java is HOT? What is Java? What is New? (Java vs C++/C)

6 Why Java is HOT? Write Once, Run Anywhere model. Network-Centric Computing (internet programming) Interactive Content and Animation (multithreading) support APIs for both client & server applications Near guarantee that you can‘t run a bad program. WWW + Java gives the world a new way to think.

7 What is Java? Simple (compared to C++) Ture object-Orentied programming Distributed Robust Secure Archetectural Neutral Multithreaded

8 What is New? No global variables -- package.class.field No preprocessor -- import statement Unicode No pointers Garbage Collection Array and String are first class objects No goto statement Single Inheritance Java documentation generator Applet with Web browsers

9 What is New? Java documentation Rich Libraries: A. 2D, 3D programming model B. 2D animation API for video game C. API for time-critical audio, vidio and MIDI data D. Multithreading E. Networking F. Security G. Exception handling ….

10 What is New? C++/C Compilation, linking & loading: C++ Program C++ Program MAC PC Sun Compiler MAC Binary File PC Sun MAC PC Sun linker & Loader

11 What is New? Java Compilation, linking, loading & verifying & JVM: Java Program Java Program MAC PC Sun Compiler MAC PC Sun Interpreter JVM Java ByteCode Java ByteCode

12 How Java Works? Java Program Java Program Java Compiler Java Compiler Loader Verifier JVM Java ByteCode Java ByteCode Network or File System Network or File System HARDWAREHARDWARE

13 C/C++ Process Image Heap Text Stack Text: compiled program code (Functions or methods) Stack: local variables, parameters, return address Heap: dynamic allocation memory C: mallac and free C++: new and delete

14 Java Process Image Heap Text Stack Text: compiled program code (Functions or methods) Stack: primitives (char, byte, int, float, double, …) handles (addresses) of objects, parameters, return address Heap: dynamic allocation memory create: new delete: garbage collector

15 Java Programs Java standalone applications: Fully access your system resources (e.g. read/write files). Java applets: No read/write access Can not standalone, Need browsers (appletviewer, Netscape, IE).

16 Java Standalone Applications Public class HelloWeb { public static void main(String args[]) { System.out.println(“Hello Web!”); } Compilation: javac HelloWeb.java ==> HelloWeb.class Execution: java HelloWeb

17 Java Applets Public class HelloWebApplet extend java.applet.Applet { public void paint(java.awt.Graphs g) { g.drawString(“Hello Web!”, 125, 95); } HTML: Hello Web Applet Example

18 Conclusions Java is a pure OO programming language Cross-platform applications (Write Once Run Anywhere) WWW + Java gives the world a new way to think. 完成 Lecture 1 休息十分鐘!


Download ppt "Java -- A very Hot Object- Oriented Language Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute."

Similar presentations


Ads by Google