Title: What is Java?
1What is Java?
- Object Oriented Programming Language
- Sun Microsystems
- Write Once, Run Everywhere
- Bytecode and Virtual Machine
- Java Platform (Java VM and Java API)
2Java History
- Started 1991 by Gosling, Sheridan, Naughton (The
Green Team) - Oak for Consumer Electronics
- Mosaic 1993
- March 1995 v1.0a2
- Netscape and Java, May 23, 1995
3(No Transcript)
4(No Transcript)
5(No Transcript)
6(No Transcript)
7(No Transcript)
8(No Transcript)
9(No Transcript)
10(No Transcript)
11Java As Programming Language
- Simple
- Object-Oriented
- Distributed
- Interpreted
- Robust
- Secure
- Architecture Neutral
- Portable
- High-Performance
- Multithreaded
- Dynamic
12What you get with Java
- The essentials Objects, strings, threads,
numbers, input and output, data structures,
system properties, date and time, and so on. - Applets The set of conventions used by applets.
- Networking URLs, TCP (Transmission Control
Protocol), UDP (User Datagram Protocol) sockets,
and IP (Internet Protocol) addresses.
13(No Transcript)
14- Internationalization Help for writing programs
that can be localized for users worldwide.
Programs can automatically adapt to specific
locales and be displayed in the appropriate
language. - Security Both low level and high level,
including electronic signatures, public and
private key management, access control, and
certificates. - Software components Known as JavaBeans, can plug
into existing component architectures.
15- Object serialization Allows lightweight
persistence and communication via Remote Method
Invocation (RMI). - Java Database Connectivity (JDBC) Provides
uniform access to a wide range of relational
databases.
16Object Oriented
- Data Structure and behavior are incorprated in
discrete objects - identity, classification, polymorphism,
inheritance - Identity Data is quantized into discrete,
distinguishable entities called objects. - Classification Objects with same attributes and
behavior are grouped in classes
17- Class An abstraction that describes properties
important to an application and ignores the rest - Instance Each object is an instance of a class.
- Polymorphism Same operation may behave
differently on different classes. Specific
implementation of an operation is a method. - Inheritance Sharing of attributes and operations
among classes based on a hierarchical
relationship
18OO Development
- Model Concepts Not Implementation
- Analysis
- System Design
- Object Design
- Implementation
19Key Themes
- Abstraction Focus on the essential, inherent
aspects of an entity and ignoring the accidental
properties - Encapsulation or Information Hiding Separate the
external aspects of an object from the internal
implementation details - Combine Data and Behavior
20- Sharing
- Emphasize object structure not procedural
structure - Synergy
21Hello World
22Comments
The Java language supports three kinds of
comments / text / The
compiler ignores everything from / to /.
/ documentation / This indicates a
documentation comment (doc comment, for short).
The compiler ignores this kind of comment, just
like it ignores comments that use / and /.
The JDK javadoc tool uses doc comments
when preparing automatically generated
documentation. For more information on javadoc,
see the Java tool documentation. // text
The compiler ignores everything from
// to the end of the line.
23Applet
24HTML
ltHTMLgt ltHEADgt ltTITLEgt A Simple Program
lt/TITLEgt lt/HEADgt ltBODYgt Here is the output of my
program ltAPPLET CODE"HelloWorld.class"
WIDTH150 HEIGHT25gt lt/APPLETgt lt/BODYgt lt/HTMLgt