下载此文档

java课件——第7章.ppt


文档分类:IT计算机 | 页数:约26页 举报非法文档有奖
1/26
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/26 下载此文档
文档列表 文档介绍
Chapter 7: Package and Interface
6-2
Outline
Package
Interfaces
3-3
Class Libraries
A class library is a collection of classes that we can use when developing programs
The Java standard class library is part of any Java development environment
Its classes are not part of the Java language, but we rely on them heavily
Various classes we've already used (System , Scanner, String) are part of the Java standard class library
Other class libraries can be obtained through third party vendors, or you can create them yourself
3-4
Packages
The classes of the Java standard class library anized into packages
Some of the packages in the standard class library are:
Package






Purpose
General support
Creating applets for the web
Graphics and graphical user interfaces
Additional graphics munication
Utilities
XML document processing
3-5
The import Declaration----use classes from a package
When you want to use a class from a package, you could use its fully qualified name

Or you can import the class, and then use just the class name
import ;
To import all classes in a particular package, you can use the * wildcard character
import .*;
3-6
The import Declaration
All classes of the package are imported automatically into all programs
It's as if all programs contain the following line:
import .*;
That's why we didn't have to import the System or String classes explicitly in earlier programs
The Scanner class, on the other hand, is part of the package, and therefore must be imported
Define Packages
A way of grouping and naming a collection of related classes
they do not have to be in the same directory as your program
The first line of each class in the package must be the keyword package followed by the name of the package: package ;
Package Naming Conventions
Use lowercase
The name is the file pathname with

java课件——第7章 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数26
  • 收藏数0 收藏
  • 顶次数0
  • 上传人wzt520728
  • 文件大小221 KB
  • 时间2018-06-07