0% found this document useful (0 votes)
192 views

Lecture 02 - POP vs. OOP, Java Features, Class, Object

Object oriented programming focuses on objects rather than functions. Programs are divided into objects that can communicate through member functions. OOP provides features like data hiding, access specifiers, and overloading that make the code more secure and robust compared to procedural programming. In Java, a class acts as a blueprint to create multiple object instances that represent real world entities. A class can contain fields, methods, constructors and more.

Uploaded by

Sanjoy Pathak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views

Lecture 02 - POP vs. OOP, Java Features, Class, Object

Object oriented programming focuses on objects rather than functions. Programs are divided into objects that can communicate through member functions. OOP provides features like data hiding, access specifiers, and overloading that make the code more secure and robust compared to procedural programming. In Java, a class acts as a blueprint to create multiple object instances that represent real world entities. A class can contain fields, methods, constructors and more.

Uploaded by

Sanjoy Pathak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lecture 2: POP vs.

OOP, Java Features, Class, Object

Differences between procedural and object oriented programming:


POP OOP
Divide Into In POP, program is divided into small In OOP, program is divided into parts
parts called functions. called objects.
Importance In POP, importance is not given to data In OOP, Importance is given to the data
but to functions as well as a sequence of rather than procedure or functions
actions to be done. because it works as a real world.
Data Hiding POP does not have any proper way for OOP provides data hiding so provides
hiding data so it is less secure. more security.
Access POP does not have any access OOP has access specifiers named Public,
Specifier specifiers. Private, Protected, etc.
Overloading In POP, Overloading is not possible. In OOP, overloading is possible in the
form of Function Overloading and
Operator Overloading.
Data Access In POP, Most function uses Global data In OOP, data cannot move easily from
for sharing that can be accessed freely function to function, it can be kept public
from function to function in the system. or private so we can control the access of
data.
Data In POP, Data can move freely from In OOP, objects can move and
Moving function to function in the system. communicate with each other through
member functions.
Approach POP follows Top Down approach. OOP follows Bottom Up approach.
Examples E.g. C, VB, FORTAN, Pascal E.g. JAVA, VB.NET, C#.NET.

Java Features or java Buzzword:


1. Simple
2. Object-Oriented
3. Portable/Platform independent
4. Architecture neutral
5. Secured
6. Robust
7. Compiled and Interpreted
8. Multithreaded
9. Distributed
10. Dynamic

Class:
A class is a group of objects which have common properties. It is a template or blueprint from
which objects are created. It is a logical entity. It can't be physical.
A class in Java can contain: Fields, Methods, Constructors, Blocks, Nested class and interface.
Syntax:
class <class_name>{
field;
method;
}

Object:
An entity that has state and behavior is known as an object.
E.g. chair, bike, marker, pen, table, car etc.

You might also like