Download presentation
Presentation is loading. Please wait.
Published byErnest Henderson Modified over 9 years ago
1
Chapter1 Introduction to Java Overview of the Java What Is the Java Technology The Java Virtual Machine A First Application in Java A First Applet in Java A Basic Java Application Using OO Java Terminology and Technology Products CCE JMU China ZhangJM 2008-09
2
Reference Thinking in Java (中、英版) The Java Tutorial Sun Microsystems Java™ Programming Language (中、英版) ( 作者: Ken Arnold 、 James Gosling 、 David Holmes) Java 程序设计教程 袁兆山等译 机械工业出版社 CCE JMU China ZhangJM 2008-09
3
Overview of Java Past Today Future CCE JMU China ZhangJM 2008-09
4
Originally named Oak Main team members: Bill Joy, Patrick Naughton, Mike Sheridan, James Gosling Original goal: use with home appliances In 1994, team realized Oak was perfect for Internet Announced in May of 1995 First non-beta release in 1996 Java technology is free The Origin of the Java Programming Language CCE JMU China ZhangJM 2008-09
8
Java 的渗透力 CCE JMU China ZhangJM 2008-09
9
Java belongs to the world CCE JMU China ZhangJM 2008-09
10
Joining & Sharing CCE JMU China ZhangJM 2008-09
12
What Is the Java Technology? Java technology is: A programming language A development environment An application environment A deployment environment It is used for developing both Applets and Applications CCE JMU China ZhangJM 2008-09
13
Java Is A Programming Language CCE JMU China ZhangJM 2008-09
14
Java Is A Platform CCE JMU China ZhangJM 2008-09
15
Building a Better Language Object-oriented Distributed Multi-threading Security APIs (pre-written code) Easily portable to multiple platforms (Write Once, Run Anywhere™) CCE JMU China ZhangJM 2008-09
16
Primary Goals of the Java Technology Provides an easy-to-use language by: Avoiding many pitfalls of other languages Being object-oriented Enabling users to create streamlined and clear code Provides an interpreted environment for: Improved speed of development Code portability CCE JMU China ZhangJM 2008-09
17
Primary Goals of the Java Technology The following features fulfill these goals: The JVM Garbage collection Code security CCE JMU China ZhangJM 2008-09
18
Java Programs Applets and Applications Application – Runs in the operating system Applet – Runs in a browser, does smaller tasks CCE JMU China ZhangJM 2008-09
19
Basic Components of a Computer CCE JMU China ZhangJM 2008-09
21
Applications must use same languages as operating and hardware CCE JMU China ZhangJM 2008-09
22
Two Ways of Solving the Communication Problem Compiled - communicates with only one kind of computer Interpreted - communicates with any kind of computer CCE JMU China ZhangJM 2008-09
27
How Applications Run
28
How Applets Run CCE JMU China ZhangJM 2008-09
30
A First Application in Java //A First Application in Java public class HelloWorld{ public static void main(String[] args){ System.out.println("Hello World!"); } CCE JMU China ZhangJM 2008-09
31
Run the Application HelloWorld CCE JMU China ZhangJM 2008-09
32
A first Applet in Java // A first Applet in Java import javax.swing.JApplet; // 导入 Java API 的 JApplet 类 import java.awt.Graphics; // 导入 Java API 的 JGraphics 类 public class HelloWorldApplet extends JApplet { public void paint( Graphics g ) { g.drawString( "Hello World!", 25, 25 ); } 创建 HTML 文件,以将 HelloWorldApplet.java 编译所得 HelloWorldApplet.class 载入浏览器运行。 HelloWorldApplet.html 文件为: CCE JMU China ZhangJM 2008-09
33
Run the applet HelloWorldApplet CCE JMU China ZhangJM 2008-09
34
Run the applet HelloWorldApplet CCE JMU China ZhangJM 2008-09
39
The Java Technology Products and Terminology
40
CCE JMU China ZhangJM 2008-09
42
各章内容概述 CCE JMU China ZhangJM 2008-09
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.