SlideShare una empresa de Scribd logo
1 de 66
讲座即将开始 “企业信息系统研发与实施技术”系列讲座
品味一杯热咖啡Java 技术 今日议题 国网电力科学研究院/南瑞集团 信息技术研究所/信息系统分公司 开发部 南京师范大学 中北学院信息系 02级信息管理专业13班 李    昕 Java的前世今生  Java是什么  Java与面向对象编程  Java学习曲线  Java开发工具介绍  Java书籍推荐 交流与讨论
第一章 Java 的前世今生 介绍Java语言的起源、发展史和现状
Java的前世 1991年SUN MicroSystem公司的James Gosling等人,为在电视、控制烤箱等家用消费类电子产品上进行交互式操作而开发了一个名为Oak的软件。
名称的由来 Java的名称是来源于太平洋一个名为Java的小岛,该岛出产一种味道非常美妙的咖啡。James认为该计算机语言是非常好的东西,所以把他认为最好的名字给了她。
横空出世 直到1994年下半年,Internet的迅猛发展,促进了Java语言研制的进展,使得它逐渐成为Internet上受欢迎的开发与编程语言。
业界评价 Sun 公司总裁 Scott McNealy认为  “Java为Internet和WWW开辟了一个崭新的时代。”
业界评价 Microsoft 公司总裁 Bill Gates评价说  “Java是长时间以来最卓越的程序设计语言”
业界评价 而当开发者们第一次观看Java演示时…     全场惊呼“Wow!!!zzzz!!!!”
Java编年史 Java 已经走过了她第15个年头
无可争议的市场占有率 目前,全世界采用 Java 的设备已超过 45 亿
广纳开发者 2000年,Java已经成为世界上最流行的电脑语言。 迄今为止,Java 平台已吸引了 650 多万软件开发者。
2009年3月编程语言排行榜 迄今为止,Java 平台已吸引了 650 多万软件开发者。
Java目前的强项与弱项 Java SE和Java EE被广泛运用于互联网网站和企业应用的服务器端。 Java ME在近几年几乎被嵌入到了每一台移动手机终端上。 由于受到微软的客户端技术和Adobe公司的Flash技术的冲击影响,Java SE所倡导的WebStart技术和Java Applet技术已逐渐淡出人们的视线。
第二章 Java 是什么 Java is a cup of hot coffee!
Java是什么 人们通常说的Java是Java编程语言、Java运行环境和类库的统称。 Java编程语言是个简单、面向对象、分布式、解释性、健壮、安全与系统无关、可移植、高性能、多线程和动态的语言。
JRE和JVM是什么 JRE是Java Runtime Environment的简称。 JRE内部有一个Java虚拟机器(Java Virtual Machine,JVM)以及一些标准的类库。 通过JVM的虚拟机才能在设备上执行Java应用程式(Java Application)。
小贴士:如何在你的计算机上运行Java程序 在www.java.com上进入“下载”栏目,便可以下载到JRE安装文件。 安装JRE,并更新到最新版本。 目前JRE的版本为JRE 6.0 u12
JDK是什么 JDK是Java Development Kit的简称。 JDK包含了编译器、打包工具、文档示例等。 JDK中包含了完整的JRE。
小贴士:如何在你的计算机上编译 在http://java.sun.com/上选择downloads,然后选择“Get the JDK download”。 安装下载Java SE Development Kit 目前最新版本为 6.0 u12
JRE和JDK的比较 ,[object Object]
不同版本的操作系统应当使用不同的JRE和JDK。,[object Object]
“一次编译,到处运行”
Java语言的特点 面向对象性。一切皆为对象。 可移植性,可跨操作系统、跨设备执行 安全性 支持多线程技术 支持自动垃圾回收机制 语言总体风格继承自C/C++,与C#语言最为相像
Java的命名规范 包(Package) 名称一律小写,中间用“.”分割。 自己定义的包的名称之前加上唯一的前缀, 所以一般采用自己在互联网上的域名称作为程序包的唯一前缀,通常采用相反的顺序。如域名“ant.apache.org”对应的包名就是“org.apache.ant”。
Java的命名规范 类(Class) 名称一律以大写字母开头,采用驼峰式命名法。如“DataAdapter”。 通常由多个单词组成,每个单词都应该以大写开头,中间不要加空格或“_”。 抽象类可以以“Abstract”开头。如“AbstractDataAdapter”
Java的命名规范 接口(Interface) 名称一律以大写字母“I”开头,以表示“interface”。紧接着的单词同样以大写字母开头,采用驼峰式命名法。如“IDataAdapter”。 很多情况下为了说明接口、抽象类、实现类的继承关系,习惯上使用以下类似的系列命名: IDataAdapter  接口 AbstractDataAdapter   抽象类 DefaultDataAdapter  默认实现类 DataAdapterFactory  工厂类
Java的命名规范 方法(Method) 名称的首字母小写,同样采用驼峰式命名法。 第一个单词应该是动词,如“get”、“create”、“remove”等。 可以采用动宾短语作为方法名称,如“createBusinessData”、“removeItem”等。 参数名称建议可以以“p_”开头,如: BusinessData getBusinessData(String p_id, String p_name);
Java的命名规范 属性(Property) Java中的属性,通常是由两个一组的方法组成的,分别称为getter和setter。 只有getter没有setter的属性被称为只读属性。 getter以“get”开头,setter以“set”开头。 动词后的名称采用驼峰式命名法。如“getName()”、“getId()”等。
Java的命名规范 常数(CONST) Java中的常数变量全部由大写字母组成,单词中间用“_”分割,如“MAX_VALUE”、“ROLE_ID”等。
Java的命名规范 私有成员(Private Member) 私有的字段或方法名称以“_”开头,如“_count”、“_internalCreateData()”等。
Java的工程项目目录 src目录 存放Java源文件的目录。 lib目录 存放项目中使用到的第三方类库目录。 build或bin目录 编译后的发布目录。 doc,docs或xdocs目录 文档目录。 samples目录 示例目录。
某年某月有几天?
将Console ui 移植到GRAPHIC UI——SWT框架实践
第三章 Java 与面向对象 介绍Java语言和面向对象之间的关系,并简单介绍设计模式
一些必要的知识 一个程序可以有许多类 在Java中所有代码都必须封装在类中 为了更好的管理类,我们使用类似文件夹式的“包(Package)”来有效组织类 类的成员具有不同的可见性 类和类之间的关系常见的有继承、引用、聚合等
电子消费示例
从电子消费示例引发的思考 在过去,面向过程设计接口时 	function 消费者购买播放器( 消费者:String, 播放器名称:String,         播放器价格:int, 播放器内存大小:int)     { (购买播放器的特定逻辑)     }
从电子消费示例引发的思考 在过去,面向过程设计接口时 	function 消费者购买相机( 消费者:String, 相机名称:String,         相机价格:int, 相机倍率:int)     { (购买相机的特定逻辑) (与购买播放器重复的逻辑)     }
从电子消费示例引发的思考 现在,采用对象思想重新设计 class 消费者 { 		function 购买(商品:Product)      { 			(封装购买商品的逻辑)      } }
从电子消费示例引发的思考 更友好的代码可读性 代码分布在各自类中 接口设计更贴近于自然思维 易于多人同时开发维护 更强的复用性 减少重复性代码 高度抽象业务逻辑 易于统一开发维护业务逻辑
寻找身边的设计模式 从造车,看“不要重复设计轮子” 从攒兼容机,看“标准接口”和“多态” 从笔记本电源插座,看“适配器模式” 从重复回收使用,看“池” ……
第四章 Java 的学习曲线 介绍如何循序渐进的学习Java技术
循序渐进
语言篇 数据类型,数据类型之间的转换 变量的声明/函数的声明 数组的声明 条件控制与循环控制语句 异常处理语句 * 在此阶段可采用“比较学习法”,与C#、C++等语言做语法比较,加深印象 * 可以做“闰年判断”“斐波那契数”等习题
面向对象初级篇 包/类/接口的声明 成员的声明/访问性 属性的读写访问控制 类的继承,抽象类 多态与override 函数的overload * 在此阶段,可以用Java实现数据结构中的LinkList、Stack等类
类库篇 字符串处理的常用方法 日期处理的常用方法 Math数学函数库 集合数据结构与工具类(java.util包) I/O流操作、文件操作 网络访问 HTTP协议访问 Socket访问 * 此阶段每一个知识点都必须至少写一个测试!!
初级应用篇 桌面应用 AWT框架 SWING框架 SWT框架(*个人最钟爱) Applet框架 网页应用 JSP框架 WebService应用 XFire 一定要多实践!一定要与Eclipse等工具结合!
移动应用篇 手机应用 JavaME的开发/发布过程 MIDP 2.0框架 二维GDI绘图 外设交互 网络访问,本地文件访问 重视实践,大胆创新!
数据库篇 数据库访问是迈入企业应用开发的第一步 需要具备一定的SQL语言基础 全面了解JDBC技术 如何增/删/改/查数据 注意数据库的异常处理 * 在此阶段,可以做的习题非常多,可以以大作业为最终目标
XML篇 学习XML的基础知识,什么是文档、声明、节点、元素、属性、文本 * 学习XPath查询语言 * 学习XSLT模板语言 在初步掌握以上知识的基础上,学习JDOM或DOM4J技术 现代企业应用开发、桌面应用开发离不开XML
再看一遍
第五章 Java 开发工具介绍 介绍几款流行的Java开发工具
Netbeans Sun公司建立的开放源代码的软件开发工具
JBuilder Borland公司出品的Java集成编程环境 新版本的JBuilder基于Eclipse
Eclipse Java集成开发编辑器的最大赢家 堪比Visual Studio .NET
Elipse的优势 Eclipse的本身只是一个框架平台,但是众多插件的支持使得Eclipse拥有其他功能相对固定的IDE软件很难具有的灵活性。 界面友好,所见即所得,人性化设计,专为Java程序员打造。 幕后由IBM支撑,拥有最庞大的社区支持,无论是JSP、WebService还是WinForm,都有可视化编辑器。 几乎所有开源框架,都推出Eclipse插件。 从编码到调试、测试,Eclipse为软件开发全周期提供一整套集成开发方案。
第六章 Java 书籍推荐 推荐学习Java的几本好书
JAVA API文档 ,[object Object]
查看Java源代码将极速增强你的编程技能
可以下载网友整理的简体中文CHM或PDF版
它是免费下载的!!,[object Object]
适合从零开始学习JSP
配有电子商务网站实例,[object Object]
国内第一本详细介绍JavaME的书籍
能够极大地提高移动开发人员的技术能力,[object Object]

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

A First Taste Of Java