Lecture 1D
ECOM F213
Object Oriented Programming
08/01/26
BITS, Pilani Goa campus
Prof. Anita Agrawal
Introduction
to Java
Topics:
▪Anatomy of a Java Program
▪History of Java
▪Salient Features of Java
▪Stages of Execution of Java Program
▪JVM vs. JRE vs. JDK
2 1/8/2026 10:41 PM Anita Agrawal
3
History of Java
❑ Initially called ‘Oak’, but after a while (1995), came to be
known as ‘Java’, over coffee.
❑ Name of Coffee seed
1/8/2026 10:41 PM Anita Agrawal
4
1/8/2026 10:41 PM Anita Agrawal
5
Salient Features of Java
❑ Object-oriented programming language
❑ Structured in terms of classes, which group data with
operations on that data
❑ Can construct new classes by extending existing ones
1/8/2026 10:41 PM Anita Agrawal
6
Salient features of Java contd….
▪Platform Independent:
Unlike many other programming languages including C and
C++, when compiled, it is not compiled into a code which is
platform specific, rather into “platform-independent byte
code”.
▪ It runs on a variety of platforms such as Windows, Mac OS,
and the various versions of unix.
1/8/2026 10:41 PM Anita Agrawal
7
Salient Features of Java contd…
▪Simple:
Easy to learn
▪Secure:
Enables to develop virus-free, tamper-free systems.
1/8/2026 10:41 PM Anita Agrawal
8
Salient Features of Java
▪Architecture-neutral:
Generates an architecture-neutral object file format which makes
the compiled code executable on many processors with the presence
of Java runtime system.
▪Portable:
Being architecture neutral and having no implementation dependent
aspects of the specification, makes it portable
1/8/2026 10:41 PM Anita Agrawal
9
Salient Features of Java
▪Robust:
Eliminates error-prone situations by emphasizing mainly on
compile time error checking and runtime checking.
▪Multithreaded:
Programs can be written that can perform many tasks
simultaneously.
▪Interpreted:
Java code is translated on the fly to native machine instructions
1/8/2026 10:41 PM Anita Agrawal
10
Salient Features of Java contd..
▪High Performance:
With the use of Just-In-Time compilers, Java enables high
performance
▪Dynamic: More dynamic than C or C++
Can carry extensive amount of run-time information that can be
used to verify and resolve accesses to objects on run-time.
1/8/2026 10:41 PM Anita Agrawal
11
ByteCode
▪Output of Java Compiler is not executable code but is a
Bytecode.
▪ Bytecode is a highly optimized set of instructions to be executed
by Java Runtime System (Java Virtual Machine- JVM).
▪JVM is the interpreter for Bytecode.
1/8/2026 10:41 PM Anita Agrawal
12 1/8/2026 10:41 PM Anita Agrawal
Java program: Stages of execution
13 1/8/2026 10:41 PM Anita Agrawal
14
Requirements
▪A text editor
▪The Java Development Kit (JDK)
▫Development Tools to develop your java programs
▫The Java Runtime Environment (JRE) to execute your
java Programs
» Includes Java Virtual Machine (JVM)
» Libraries
1/8/2026 10:41 PM Anita Agrawal
15
JVM vs. JRE vs. JDK
▪JVM – Java Virtual machine(JVM) – JVM is responsible for executing the
java bytecode line by line hence it is also known as interpreter – JVM allows
Java to be a "portable language" (write once, run anywhere)
▪JRE – Java Runtime Environment – An installation package which provides
environment to only run (not develop) the java program onto your machine. JRE
includes JVM and libraries – JRE is used by them who only wants to run the
Java Programs i.e. end users of your system.
▪JDK – Java Development Kit – The JDK is a superset of the JRE, and
contains everything that is in the JRE, plus tools such as the compilers and
debuggers necessary for developing programs and applications.
1/8/2026 10:41 PM Anita Agrawal
16 1/8/2026 10:41 PM Anita Agrawal
17
Compiling a Java Program
▪Execute the java compiler (javac)
–C:\>javac [Link]
▪Javac compiler will create [Link] file.
▪.class file will be created for each class in the file
▪.class file contains the bytecode version of the program
▪ Java bytecode is not an executable code
▪To execute a bytecode, we need JVM
1/8/2026 10:41 PM Anita Agrawal
18
Executing a Java Program
▪To run the program, we need Java Application Launcher called java
–C:\>java myfirstjavaprogram
▪When the program is run, the following output will be displayed:
This is my first Java program
1/8/2026 10:41 PM Anita Agrawal
19
JDK editions
A. Java Standard Edition (J2SE)
▫J2SE can be used to develop client-side standalone
applications or applets.
B. Java Enterprise Edition (J2EE)
▫J2EE can be used to develop server-side applications such as
Java servlets and Java ServerPages.
C. Java Micro Edition (J2ME)
▫J2ME can be used to develop applications for mobile devices
such as cell phones.
1/8/2026 10:41 PM Anita Agrawal
Next …………Data Types and Variables
20 1/8/2026 10:41 PM Anita Agrawal
THANKS!
21 1/8/2026 10:41 PM Anita Agrawal