History of Java
Java is a general purpose object oriented
Developed by James Gosling, Patrick
Naughton, Chris Warth, Ed Frank, and Mike
Sheridan at Sun Microsystems, Inc. in 1991.
Initially called “Oak” but was renamed as “Java” in
1995 after the coffee used to named „Java coffee‟.
Initial motivation is to develop a platform
independent language to create software to be
embedded in various consumer electronics
devices, evenly over mobile devices.
Become the language of internet. (portability and
Features of Java
1. Simple, Small and Familiar
2. Compiled and Interpreted
3. Object Oriented
4. Platform Independent and portable
5. Robust and Secure
6. Distributed / Network Oriented
7. Multithreaded and Interactive
8. High Performance
Simple, Small and Familiar
Similar to C/C++ in syntax
But eliminates several complexities like -
No operator overloading
No direct pointer manipulation or pointer
No multiple inheritance (exclusion of Dimond
No malloc() and free(). It handles memory
automatically with the help of garbage collector.
Compiled and Interpreted
Java works in two stage
Java compiler translate the source code into byte
Java interpreter converts the byte code into
machine level representation. (Java /Just-In-Time)
-A highly optimized set of instructions to be
executed by the java runtime environment, known
as java virtual machine (JVM).
Java Virtual Machine (JVM):
- Need to be implemented for each platform.
- Although the details vary from machine to
machine, all JVM understand the same byte code.
Java Virtual Machine
Java compiler produces an intermediate
code known as byte code for a
machine, known as JVM.
It exists only inside the computer memory.
Machine code is generated by the java
interpreter by acting as an intermediary
between the virtual machine and real
Java Virtual Machine
Java Interpreter /
Just In Time
Fundamentally based on OOP
Classes and Objects
Efficient re-use of packages such
that the programmer only cares
about the interface and not the
The object model in java is simple
and easy to extend.
Platform Independent and
Changes in system resources will not
force any change in the program.
The Java Virtual Machine (JVM) hides
the complexity of working on a
Convert byte code into machine level
Robust and Secure
Designed with the intention of being secure
No pointer arithmetic or manual memory
Strict compile time and run time checking
of data type.
It verify all memory access
Ensure that no viruses are communicated
with an applet.
Distributed and Network Oriented
Java grew up in the days of the Internet After
FreeBSD came in the picture.
Berkeley Software Distribution (pioneers
Inherently network friendly
Original release of Java came with
Newer releases contain even more for
handling distributed applications.
RMI (remote method
Multithreaded and Interactive
Handles multiple tasks simultaneously.
Java runtime system contains tools to
support multiprocess synchronization and
construct smoothly running interactive
Java supports Threading to modulate the
task and is capable of handling it.
Java performance is slower than C, because it
handles more complicated task than C language.
Incorporation of multithreading enhance the
overall execution speed.
Just-in-Time (JIT) can compile the byte code into
Can sometimes be even faster than compiled C
As it dose not include the library files as like C
into the byteCode file, its linking & working is
Capable of dynamically linking a new class
libraries, methods and objects, with the OOPS
Java can use efficient functions available in
C/C++. Means it can connect the source code of
C,C++ with its source code.
Installing new version of library
files, automatically updates all programs as the
library is linked and not included.
The C# Connection
The reach and power of Java continues to be felt in the
world of computer language development.
Many of its innovative features, constructs, and
concepts have become part of the baseline for any
new language. The success of Java is simply too
important to ignore.
Perhaps the most important example of Java‟s
influence is C#. Created by Microsoft to support the
.NET Framework, C# is closely related to Java. For
example, both share the same general syntax, support
distributed programming, and utilize the same object
There are, of course, differences between Java and
C#, but the overall “look and feel” of these languages
is very similar. This “cross-pollination” from Java to C#
is the strongest testimonial to date that Java redefined
the way we think about and use a computer language.
Language of Internet
Special java program that can transmitted over the
network and automatically executed by a java-compatible
web browser or Applet runner.
Java compatible web browser can download java
applets without fear of viral infection and malicious
As the Applet dose not request for the main() function
to run it, so it cannot hamper the computer system. No
Admin rights provided to Applet.
Java applets can be dynamically downloaded to all the
various types of platforms connected to the internet.
Why portable and Secure?
The output of java compiler is not executable code.
Once JVM exists for a platform, any java program can
run on it.
The execution of byte code by the JVM makes java
Actually for different platform separate JVM is made.
Java program is limited within the java execution
environment (JVM) and cannot access the other part of
the computer. That why it is secure.
Basics of Java Environments
Java programs normally undergo five phases
Programmer writes program / source code (and stores program on disk in
Compiler creates bytecodes from source code (.class file)
Class loader stores bytecodes in memory (it is part of JVM). There are 3
loaders in JVM –
Bootstrap class loader
Extensions class loader
System class loader
Verifier ensures bytecodes do not violate security requirements
Interpreter translates bytecodes into machine language
created in an
editor and stored
on disk in a file
stores them on
disk in a file
disk and puts
confirms that all
valid and do not
into a language
that the computer
data values as the
Languages that JVM understand
These languages are made with the help of Java but some of them
are independent of JVM and some are not.
Development tools - part of java development kit (JDK).
Runtime Environment – Java Runtime Environment.
Classes and methods - part of Java Standard Library
(JSL), also known as Application Programming Interface
Inclusions in JDK:
Appletviewer ( for viewing applets)
Javap (Java disassembler)
Javah (for C header files)
Javadoc ( for creating HTML description)
Jdb (Java Debugger)
Java Environment (Cntd.)
2. Application Package Interface (API)
Contains hundreds of classes and methods grouped
into several functional packages:
Language Support Package
Input / Output Packages
The Evolution of Java
1. Java 1.0 (January 23, 1996)
2. Java 1.1 (February 19, 1997) (Add new library, redefine applet
handling and reconfigured many features.)
3. Java 2 (Second generation) (December 8, 1998) . Version
no:1.2 (Internal version number of java library). Also known as
J2SE [ Java 2 Platform Standard Edition].
- Add swing, the collection framework, enhanced JVM etc.
4. J2SE 1.3 (May 8, 2000)
5. J2SE 1.4 (February 6, 2002)
6. Java 5 (fifth generation). Version no: 1.5 (Internal version
number of java library) (September 30, 2004)
7. Java 6 (sixth generation). Version no: 1.6 (Internal version
number of java library) (December 11, 2006).
8. Java 7 (sixth generation). Version no: 1.7 (Internal version
number of java library) (July 28, 2011)
Versions of Java
Three versions of the Java 2 Platform, targeted at different uses
Java 2 Micro Edition (J2ME)
Very small Java environment for smart
cards, pages, phones, and set-top boxes
Subset of the standard Java libraries aimed at limited size and
Java 2 Standard Edition (J2SE)
The basic platform
J2SE can be used to develop client-side standalone
applications or applets.
Java 2 Enterprise Edition (J2EE)
For business applications, web services, mission-critical
Transaction processing, databases, distribution, replication