1 / 16

Java 程序设计

Java 程序设计. 授课教师: 赵光煜 E-mail: zhaoguangyu_tjac@163.com 课件及软件下载网址: http://netsky.tjac.edu.cn. 历史简短回顾. Bill Joy: 在20世纪70年代末期创立了这种思想 更多的文献: 1990 James Gosling: 拟开发先进软件系统的研究计划 (1990) Patrick Naughton: 绿色项目 (1990) Oak :开发消费性电器的利器 (1991.8) Oak( 此研究计划最初的代称): 一种由 Sun 公司开发的面向对象的编程语言

hazel
Download Presentation

Java 程序设计

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java程序设计 授课教师: 赵光煜 E-mail:zhaoguangyu_tjac@163.com 课件及软件下载网址:http://netsky.tjac.edu.cn

  2. 历史简短回顾 • Bill Joy:在20世纪70年代末期创立了这种思想 • 更多的文献: 1990 • James Gosling: 拟开发先进软件系统的研究计划 (1990) • Patrick Naughton: 绿色项目 (1990) • Oak :开发消费性电器的利器 (1991.8) Oak(此研究计划最初的代称): 一种由Sun公司开发的面向对象的编程语言 • 1993: 设计一种盒子作为远程控件 • 1994: Web浏览器,称为HotJava浏览器

  3. Java • 在某一平台上编写的程序可以运行于多平台 • 编写运行于Web浏览器中的程序: Applet • 服务器端应用: 在线书店,论坛等: Servlet • 消费性装置应用:蜂窝电话,寻呼机,智能卡

  4. Java • 与C++( 面向对象的 C)类似 • 垃圾收集 • 多线程 • 无指针 • 网络访问中安全的语言 • 跨平台 • 中间形式的字节码(byte code) • Java虚拟机 • 不易出错(Exception 机制)

  5. 版本 • Java 1.0 和 1.1 • Java 2 (JDK 1.2 and up)

  6. 平台 • Sparc,X86,Solaris • Windows • MacOS • SGI • Linux • OS/2, AIX, OS/400, MVS • Amiga, NextStep

  7. 技术 • J2SE : 标准版 (Standard Edition) • J2EE : 企业版 (Enterprise Edition) • J2ME: 微型版 (Micro Edition)

  8. JDK • JDK 1.4.1: 新 • JDK 1.4.0 • JDK 1.3.2 • 从此处下载: java.sun.com/j2se/downloads.html

  9. 认证 • SCJP : Sun公司对Java平台的程序员认证 • SCJD : Sun公司对Java平台的开发者认证 • SCEA: Sun公司对J2EE技术的企业架构师认证

  10. Java的特点 • 简单 • 网络特性 • OOP: 面向对象 • 平台无关性/可移植性 • 鲁棒性 • 安全性 • 多线程性 • 解释性 • 生产力: 进入市场的时间更快 • Internet: applets, servlets, JSP

  11. 第一个Java Application Java虚拟机

  12. 源代码 注释 公共类必须放在与其同名的文件中 // HelloWorldApp.java import java.util.*; 导入程序包 public class HelloWorldApp { public static void main(String[] args) { System.out.println(“Hello, world!”); } } 类方法,通过类名可直接调用参数(引数)列表 程序入口,整个程序只能有一个 main() 所有的类都可用此方法 类System提供程序访问系统资源的方法. System.in 代表键盘,System.out 代表监视器

  13. 编译和运行 • 安装 JDK: java.sun.com • 设置 PATH=c:\j2sdk1.4.1_01\bin;… • 编译: javac HelloWorldApp.java • 字节码: HelloWorldApp.class • 运行: java HelloWorldApp • 反编译: javap HelloWorldApp

  14. 第一个Java Applet • applet 在支持Java的浏览器上运行 • 嵌入HTML页面中 • 可以使用appletviewer来测试

  15. HelloWorld.java import java.applet.*; import java.awt.*; /** * The HelloWorld class implements an applet that * simply displays "Hello World!". */ public class HelloWorld extends Applet { public void paint(Graphics g) { // Display "Hello World!“ g.drawString("Hello world!", 50, 25); } }

  16. Hello.html <HTML> <HEAD> <TITLE>A Simple Program</TITLE> </HEAD> <BODY> Here is the output of my program: <APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25> </APPLET> </BODY> </HTML>

More Related