OOP Chapter 1
OOP Chapter 1
05/11/2025 OOP 2
Definition of OOP
• Object-oriented programming (OOP) is a programming
paradigm based on the concept of objects, which may
contain data, in the form of fields, often known as
attributes; and code, in the form of procedures, often
known as methods
• Object means a real word entity such as dog, cat, cattle,
goat, sheep , pen, chair, table etc.
• Object-Oriented Programming is a methodology or
paradigm to design a program using classes and objects.
05/11/2025 OOP 3
...con’t
• Collection of objects is called class. It is a logical entity.
• A class can be defined as a template/blueprint that describes the
behaviour /state that the object of its type support.
• If we consider a dog, then its state is - name, breed, color, and the
behaviour is - barking, wagging the tail, running.
Popular Java Editors
o To write Java programs, we need any of the following:
o notepad - Text editor
o NetBeans - A Java IDE that is open-source and free
o eclipse - A Java IDE developed by the eclipse open-source
community
05/11/2025 OOP 4
...con’t
Following is an example of a class.
public class Dog
{
String breed;
int age;
String color;
void barking()
{
}
}
05/11/2025 OOP 5
…con’t
05/11/2025 OOP 6
…con’t
List of object-oriented programming languages
05/11/2025 OOP 7
Overview of OO Principles
Fundamental principles of Object Oriented Programming
05/11/2025 OOP 8
Con’t
Fundamental Principles of Object Oriented Programming
o Encapsulation
o Abstraction
o Inheritance
o Polymorphism
o Encapsulation
o Abstraction
o Inheritance
o Polymorphism
05/11/2025 OOP 11
Con’t
Fundamental principles of Object Oriented Programming
05/11/2025 OOP 12
Java Features
• Key features of the java language
– Simplicity
– Portable
– Flexible
– Reusabiity
– Java program is both compiled and interpreted.
– Write once, run anywhere
05/11/2025 OOP 13
Con’t
05/11/2025 OOP 14
Con’t
05/11/2025 OOP 15
JVM, Byte code and Code execution in java
• The Java Runtime Environment (JRE) is a set of
software tools for development of Java applications.
• It combines the Java Virtual Machine (JVM), platform
core classes and supporting libraries.
• The JVM is a program that provides the runtime
environment necessary for Java programs to execute.
• Java programs cannot run without JVM for the
appropriate hardware and OS platform.
05/11/2025 OOP 16
Con’t
• When the JVM takes in a Java program for
execution, the program is not provided as Java
language source code.
• Instead, the Java language source must have been
converted (or compiled) into a form known as Java
bytecode.
• Java bytecode must be supplied to the JVM
in a format called class files.
05/11/2025 OOP 17
Con’t
• These class files always have a .class extension.
• The JVM is an interpreter for the bytecode form
of the program. It steps through one bytecode
instruction at a time.
• It is an abstract computing machine that enables a
computer to run a Java program.
05/11/2025 OOP 18
thanks
Thanks a lot
05/11/2025 OOP 19