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
Reference Thinking in Java (中、英版) The Java Tutorial Sun Microsystems Java™ Programming Language (中、英版) ( 作者: Ken Arnold 、 James Gosling 、 David Holmes) Java 程序设计教程 袁兆山等译 机械工业出版社 CCE JMU China ZhangJM
Overview of Java Past Today Future CCE JMU China ZhangJM
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
Java 的渗透力 CCE JMU China ZhangJM
Java belongs to the world CCE JMU China ZhangJM
Joining & Sharing CCE JMU China ZhangJM
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
Java Is A Programming Language CCE JMU China ZhangJM
Java Is A Platform CCE JMU China ZhangJM
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
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
Primary Goals of the Java Technology The following features fulfill these goals: The JVM Garbage collection Code security CCE JMU China ZhangJM
Java Programs Applets and Applications Application – Runs in the operating system Applet – Runs in a browser, does smaller tasks CCE JMU China ZhangJM
Basic Components of a Computer CCE JMU China ZhangJM
Applications must use same languages as operating and hardware CCE JMU China ZhangJM
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
How Applications Run
How Applets Run CCE JMU China ZhangJM
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
Run the Application HelloWorld CCE JMU China ZhangJM
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
Run the applet HelloWorldApplet CCE JMU China ZhangJM
Run the applet HelloWorldApplet CCE JMU China ZhangJM
The Java Technology Products and Terminology
CCE JMU China ZhangJM
各章内容概述 CCE JMU China ZhangJM