The document provides an overview of object-oriented programming (OOP) concepts, including:
1. It discusses procedural programming and structured programming, and how OOP improved upon these approaches by emphasizing data rather than procedures. OOP focuses on representing real-world objects like menus and buttons through objects with both data and functions.
2. The core concepts of OOP are described - objects, classes, encapsulation, inheritance, polymorphism. An object contains both data (attributes) and code (methods) and is an instance of a class. Classes organize similar objects, and encapsulation binds data to methods within an object.
3. Advantages of OOP include modularity, code reusability
1 of 5
More Related Content
2nd PUC computer science chapter 6 oop concept
1. 1 YouTube channel: Study with Me Ashwini E
Ashwini E ashwiniesware@gmail.com
CHAPTER 6:
BASIC CONCEPTS OF OBJECT ORIENTED PROGRAMMING
? Programming is an important area in computer science that deals with developing solution to a
problem.
? It involves the method of writing instructions in a language that computer can understand.
? Machine languages were used in 1950¡¯s for writing programs. This was very complex and machine
specific.
? High level languages were introduced in 1960¡¯s that made programming simpler.
? Structured programming was introduced in 1970¡¯s for developing large and complex programs.
? ADA, Modula 2 ,C etc were the languages developed that time
? C++ was developed in 1980¡¯s and became the most popular object oriented language.
? Nowadays object oriented programming languages like C++,Java,C# etc are used widely for
software development.
Procedural programming:
? Any programming language in which the programmer specifies a sequence of steps to
produce the desired output is known as Procedural Language.
? Procedural programming give importance to the procedure of solving problems
? Problem is solved using a series of steps that produce the desired output. Each step tells
the compiler to do something.
? C, Pascal,FORTRAN,BASIC etc are procedural programming languages.
Structured Programming:
? Procedural technique creates programs that are badly organized and more complex.
? Prof. Dijkstra coined a new term ¡°Structured Programming¡± .
? Structured programming is an organized approach to programming involving the use of
three basic control structures- sequence, selection and looping and the use of top down
concepts to decompose main functions into lower level components for modularity.
Characteristics
? emphasis is on doing things(algorithms)
? Large programs are divided into smaller programs called functions
? Most of the functions share global data
? Data move openly around the system from function to function
? Functions transform data from one form to another
? Employs top down approach in program design
Problems with Structured Programming
? No restriction for accessing data.Global data is shared by many functions and there are chances of
data corruption.
? Procedural programs are difficult to design. To add new data items, all the functions has to be
modified.
? It is difficult to create new types of data
2. 2 YouTube channel: Study with Me Ashwini E
Ashwini E ashwiniesware@gmail.com
Object Oriented Programming:
? A Programming technique that represents concepts as ¡°objects¡± that constitute data and their associated
functions together.
? Data cannot be accessed directly.It can be accessed only through the member functions. It helps to avoid
damage to data accidently.
Characteristics:
? Emphasis is on data rather than procedure
? Programs are divided into objects
? Data is hidden and cannot be accessed by external function
? Objects communicate each other through functions
? New data and functions can be easily added whenever necessary
? Functions and data are tied together
In OOP, the programmer focuses on objects like menus on screen, command buttons on the screen etc.
Concepts used in Object Oriented Programming
? Objects
? Classes
? Message and methods
? Abstraction
? Encapsulation
? Polymorphism
? Inheritance
? Modularity
Objects:
? An Object is a real world element which has some characteristics(attributes) and behavior.
? It may represent a person, place or table of data
? An object is a collection of data and associated member functions. Attribute is represented by data
and behavior is represented by member functions.
? It has a unique name and is a member of a particular class.
? Ex: Apple, Orange,Mango etc are objects of class FRUIT
? Ex: Dog is an object of the class Animal
? Car is an object of class vehicle
? Objects take up memory space in the program.at the time of program execution, objects in the
program interact with one another by sending messages. An object communicates with another
object without knowing the background details of another object.
Object: Car
Class: vehicle
Data
functions
functions
Registration number
Colour
Manufacturer
Price etc
Opendoor()
Switchonengine()
Pressclutch()
Change gear() etc
3. 3 YouTube channel: Study with Me Ashwini E
Ashwini E ashwiniesware@gmail.com
Classes:
? A class is a way of grouping objects having similar characteristics.
? Objects are variables of type class.
? Class is a user defined data type that consists of objects. Objects contain data and code to manipulate that
data.
? In a class, we can create any number of objects.
? Planets,sun,moon , star etc are members of the class Solar system.
? Classes are a way to bind data and functions together.
? A Class is a blue print from which objects can be created
Classes
Data abstraction:
? Abstraction refers to the process of representing essential features without including background
details and explanations.
? Data abstraction permits the user to use an object without knowing its internal working.
? Class is an abstract data type.
Data Encapsulation:
? Data encapsulation combines data and functions into a single unit called class
? It helps to prevent direct access to data.
? Data can be accessed only through member functions.
? Data cannot be modified by external member functions.
Inheritance:
? The process of creating new class from existing class is known as inheritance.
? The object of one class acquires the properties of object of another class. The existing class is
called as base class and the new class is known as Derived class.
? It provides code reusability. The derived class shares the properties of base class. So the code
from base class can be reused by derived class.
? We can add additional features to an existing class without modifying it.
Polymorphism
? Polymorphism means one name, different forms.
? Polymorphism is the ability for a message(function) or data to be processed in more than one
form
Data
functions
Data1
Data2
Data3
Function1()
Function2()
Function3()
4. 4 YouTube channel: Study with Me Ashwini E
Ashwini E ashwiniesware@gmail.com
? In C, we use three different functions-abs(), labs() and fabs() to find absolute value of an
integer, long integer and floating point number respectively
? There are two types of polymorphism-Function overloading and operator overloading.
? Function overloading ¨CThe process of using same function to perform different tasks based on
the type and number of arguments is known as function overloading.
? Operator overloading-The process of using the same operator to perform multiple tasks is
known as Operator overloading.
Messages and Methods:
? Methods are equivalent to functions in traditional programming languages.
? Methods represent the behavior of an object.
? Every method has name and body
? Body is composed of instructions written in a programming language to perform a specific task.
? Ex: Changing student¡¯s combination, printing student name, address etc are methods performed
on the object student.
? A method is invoked using message sent to the object.
Dynamic binding
? It means code associated with function call is known only at the time of execution of the program
Advantages Of OOP:
? Programs are modularized based on objects and classes
? It reduces code duplication and allows code reusability
? Easy to develop code and reduces development time
? OOP can communicate through message passing which makes connection with outside system
easily
? Data is tied together with functions. External functions cannot access or modify the data thus
providing data security.
? Concept of data abstraction separates object specification and object implementation.
Limitations
? OOP software is not having a set of standards.
? To convert real world problem into object oriented model is a complex task.
? Classes are overly generalized. The relation of classes sometimes become artificial
? OOPs design is tricky
? One needs proper planning and proper design for OOP program
Applications of OOP
? Computer graphic applications
? CAD/CAM software
? object oriented database
? user interface design like windows
? real time systems
? simulation and modeling
? artificial intelligence and expert systems
5. 5 YouTube channel: Study with Me Ashwini E
Ashwini E ashwiniesware@gmail.com
4) oops(30 question )
Question paper question from this chapter 2015 to 2020
1Mention any five advantages of OOP over procedural
programming Languages.2019
2 Mention any FIVE application areas of
OOP.[2019s][2017][2015s]
3 Explain the characteristics of OOPs.[2018]
4 Explain the advantages of OOPs.[2018s][2016s][2015]
5 Give the differences between procedural oriented programming
and object oriented programming.[2017s][2020]
6 Define object oriented programming. Write the limitations of
object oriented programming.[2016]