Lecture 1 - Introduction to Java Programming
Lecture 1 - Introduction to Java Programming
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
What is Java?
Java is a general-purpose, class-based, object-oriented programming
language designed for having lesser implementation dependencies. It
is a computing platform for application development. Java is fast,
secure, and reliable, therefore. It is widely used for developing Java
applications in laptops, data centers, game consoles, scientific
supercomputers, cell phones, etc.
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Here are important landmarks from the history of the Java language:
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Java Versions
Here are a brief history of all the Java versions with its release date.
Java Versions Release Date
JDK Alpha and Beta 1995
JDK 1.0 23rd Jan 1996
JDK 1.1 19th Feb 1997
J2SE 1.2 8th Dec 1998
J2SE 1.3 8th May 2000
J2SE 1.4 6th Feb 2002
J2SE 5.0 30th Sep 2004
Java SE 6 11th Dec 2006
Java SE 7 28th July 2011
Java SE 8 18th Mar 2014
Java SE 9 21st Sep 2017
Java SE 10 20th Mar 2018
JAVA SE 11 25th Sep 2018
JAVA SE 12 19th Mar 2019
JAVA SE 13 17th Sep 2019
JAVA SE 14 17th Mar 2020
JAVA SE 15 15th Sep 2020 (latest Java Version)
h a n g e Pro h a n g e Pro
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Java Features
Here are some important Java features:
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Why JVM?
Here are the important reasons of using JVM:
JVM provides a platform-independent way of executing Java
source code.
It has numerous libraries, tools, and frameworks.
Once you run a Java program, you can run on any platform
and save lots of time.
h a n g e Pro h a n g e Pro
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
1. Java Platform, Standard Edition (Java SE): Java SE’s API offers the
Java programming language’s core functionality. It defines all the basis
of type and object to high-level classes. It is used for networking,
security, database access, graphical user interface (GUI) development,
and XML parsing.
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Programming Language :
What is a PC?
A computer is an electronic device capable of performing
computations. We all know that it is composed of a monitor,
keyboard, mouse, and memory to store information. But the most
important component of the computer is a PROCESSOR. This does all
thinking of computer, but the question is how the computer does this
thinking? How does it understand the text, images, videos, etc.?
h a n g e Pro h a n g e Pro
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
What is PC?
What is Assembly Language?
The computer is an electronic device, and it can only understand
electronic signals or binary signals. For example, the 5-volt electronic
signal may represent binary number 1, while 0 volts may represent
binary number 0. So your PC is continuously bombarded with these
signals.
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
But how are we going to do this? Back in the 1950s, when computers
were huge and consumed a great deal of power, you would convert
your assembly code into corresponding machine code to 1 and 0’s
using mapping sheets. Later, this code will be punched into the
machine cards and feed to the computer. The computer will read
these codes and execute the program. This would be a long process
then until ASSEMBLER came to help.
That apart, you will also have to make calls to create Operating System
provided functions to display the code’s output.
But alone the assembler is not involved in this process; it also requires
the compiler to compile the long code into a small chunk of codes.
With the advancement in software development languages, this
entire assembly code could shrink into just one line printf 1+2 A with
the software called COMPILER.
It is used to convert your c language code into assembly code. The
assembler converts it into corresponding machine code. This machine
code will be transmitted to the processor.
h a n g e Pro h a n g e Pro
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
By using Java Virtual Machine, this problem can be solved. But how it
works on different processors and O.S. Let’s understand this process
step by step.
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Step 3) This code is not understood by any platform, but only a virtual
platform called the Java Virtual Machine.
Hence,
“Java is a programming language as well as a Platform”
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a
Java programs compiled code is called byte code. The Java compiler
(javac) generates a byte code (intermediate code) when the Java code
is compiled.
Like the C compiler, the Java compiler does not produce native
executable code for a particular machine. Instead, Java produces a
unique format called bytecode. It executes according to the rules laid
out in the virtual machine specification. Therefore, Java is a platform-
independent language.
Summary:
Java is a multi-platform, object-oriented, and network-centric
programming language Java is a general-purpose, class-
based, object-oriented programming language.
Java Platform is a collection of programs that help
programmers to develop and run Java applications
efficiently.
Meaning of Java: Java is a multi-platform and network-centric
programming language.
It is mainly used for developing Android Apps and Enterprise
Software.
h a n g e Pro h a n g e Pro
XC d XC d
F- F-
uc
uc
PD
PD
!
!
W
W
t
t
O
O
N
N
y
y
bu
bu
to
to
ww
ww
om
om
k
k
lic
lic
C
C
.c
.c
w
w
tr re tr re
.
.
ac ac
k e r- s o ft w a k e r- s o ft w a