JAVA Programming
Course Instructor: Dr. Syed Sajid Hussain
School of Computer Science
UPES Dehradun
Let’s START THE JOURNEY
Together…!!!
Brief History of JAVA
James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java
language project in June 1991. This small team of Sun engineers was called
Green Team.
Firstly, the language was called “Greentalk” by James Gosling, and file
extension was .gt.
Java was originally designed for small, embedded systems in electronic
appliances like set-top boxes, but at that time, it was too advanced technology
James for the digital cable television industry.
Gosling
After that, it was called Oak, and was developed as a part of the Green project.
Java team-members initiated this project to develop a language for digital
devices.
Later, Java technology was incorporated by Netscape as it was suited for
networking.
Why the name JAVA???
Java was called Oak as it is a symbol of strength and chosen as
a national tree of many countries like U.S.A., France,
Germany, Romania, etc.
The team wanted something that reflected the essence of the
technology: revolutionary, dynamic, lively, cool, unique, and
easy to spell and fun to say.
In 1995, Oak was renamed as Java (An island of Indonesia is
named Java where first coffee was produced, called java coffee)
In 1995, Time Magazine called Java one of ten best products of
1995.
JDK (Java Development Kit) 1.0 released in January23, 1996.
Characteristics of JAVA
Robust Architecture-
Simple Neutral
Object Platform
Oriented Independent
/ Portable
Distributed
Dynamic
Secure
High Multi-
Performance threaded
JAVA is Architecture-Neutral
Write (W)
Once (O)
Run (R)
Anywhere (A)
JAVA is Architecture-Neutral (Contd..)
Object Oriented Paradigm of JAVA
Java is based on the concept of Object-Oriented Programming (OOP).
As the name suggests, at the centre of it is (are) an object(s).
Objects contain both data and the functionality that operates on that data.
Encapsulation
Inheritance
Information hiding
Polymorphism
Encapsulation
Encapsulation in Java is a process of wrapping code and data together into
a single unit.
For example, a capsule which is a mix of several medicines.
Encapsulation (Example)
Inheritance
Inheritance in Java is a mechanism in which one object acquires all the
properties (data) and behaviours (methods) of a parent object.
The Child object may have its own data and methods as well.
Information hiding
In Java, we have access specifiers which
allow the one class of objects to hide
relevant information from its child objects
and objects of other classes.
• Public
• Protected
• Private
Polymorphism
In Object Oriented Programming (OOP),
Polymorphism refers to a programming
language’s ability to process objects depending
on their class.
JAVA Program Back-end Setup
Java Developer’s Kit (JDK) – I
Java’s programming environment
Core Java API
compiler
interpreter
debugger
dis-assembler
profiler
more...
Execution of JAVA Program
Bytecode
For most languages, compilation produces machine
code
Java compilation produces “bytecode”
• Intermediate code readable by the VM
• Transferable across the Internet as applets
JVM interprets bytecodes into instructions
• Partly responsible for performance lag
Bytecode produced on any platform may be executed
on any other platform which supports a VM
JIT Compiler
Just-In-Time compiler
Translates bytecode into machine code at
runtime
• 1-time overhead when run initiated
• Performance increase 10-30 times
Now the default for most JVM’s
• Can be turned off if desired
• JIT can apply statistical optimizations
based on runtime usage profile
Java Virtual Machine (JVM)
Not just one JVM, but a whole family
JVM (J2EE & J2SE)
• Well-known Java Virtual Machine.
CVM, KVM (J2ME)
• Small devices.
• Reduces some VM features to fit resource-
constrained devices.
JCVM (Java Card)
• Smart cards.
• It has least VM features, etc.
Summary
Today, we learned about
• Brief History of JAVA Programming • Back-end Setup and Execution model for
JAVA program
• Features of JAVA Programming Language
Bytecode
• Why JAVA is Architecture-Neutral /
Portable / Platform-independent? JIT Compiler
JVM
• OOP Concepts in JAVA
Encapsulation
Inheritance
Information hiding
Polymorphism