Introduction to Java
1
Java Background: History
● Java
– was created in 1991
– by James Gosling et al. of Sun Microsystems.
– Initially called Oak, in honor of the tree outside Gosling's window, its name
was changed to Java because there was already a language called Oak.
2
Java Background: History
● Java
– The original motivation for Java
● The need for platform independent language that could be embedded in various
consumer electronic products like toasters and refrigerators.
– One of the first projects developed using Java
● a personal hand-held remote control named Star 7.
– At about the same time, the World Wide Web and the Internet were gaining
popularity. Gosling et. al. realized that Java could be used for Internet
programming.
3
Why Java is popular?
● Simple
Java removes several C and C++ features considered to be
unsafe
● Object-oriented
It enforces OO design.
● Robust
Java checks for problem at compile and run-time.
● Secure
Java code passes several test before actually executing it
on the machine.
4
Why Java is popular?
● Distributed
Java has extensive TCP/IP capabilities that have been built
in, which allow easy access to information over a network.
● Architectural Neutral
Java compiler complies code into a platform-independent
object file format.
● Portable
Java code can be implemented on UNIX, PC and MAC.
● Multithreaded
Java allows many simultaneous activities in one program.
5
Java Background:
What is Java Technology?
● The Java technology is:
– A programming language
– A development environment
– An application environment
– A deployment environment
6
Java Technology:
Programming Language
● As a programming language, Java can create all kinds of
applications that you could create using any conventional
programming language.
7
Java Technology:
A Development Environment
● As a development environment, Java technology provides
you with a large suite of tools:
– A compiler
– An interpreter
– A documentation generator
– A class file packaging tool
and so on...
8
Java Technology:
An Application and Runtime Environment
● Java technology applications are typically general-purpose
programs that run on any machine where the Java runtime
environment (JRE) is installed.
● There are two main deployment environments:
1. The JRE supplied by the Java 2 Software Development Kit (SDK)
contains the complete set of class files for all the Java technology
packages, which includes basic language classes, GUI component
classes, and so on.
2. The other main deployment environment is on your web browser.
Most commercial browsers supply a Java technology interpreter and
runtime environment.
9
Phases of a Java Program
● The following figure describes the process of compiling and
executing a Java program
10
Phases of a Java Program
11
Summary
● Java Background
– History
– Java Technology
● A programming language, development environment, application environment
and deployment environment
● Phases of a Java Program
– Write, compile, run
12