oop concepts
TRANSCRIPT
Neethu.T
Neethu thottath
neethoosT
Neethu.Neethoos
21wpm
OOP CONCEPTS
Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
OOP Concepts
• The core of the pure object-oriented programming is to create an object
• An object that has certain properties and methods
• Programs are divided into what are known as objects
• Objects may communicate with each other through functions
OOP Concepts
• New data and functions can be easily added whenever necessary
• For example a car is an object which has certain properties such as colour, number of doors etc
• It also has certain methods such as accelerate, brake, and so on
Basic concepts of OOP
• Objects
• Class
• Data abstraction
• Data Encapsulation
• Inheritance
• Polymorphism
Objects
• This is the basic unit of object oriented programming
• That is both data and function that operate on data are bundled as a unit called as object
• Program objects should be chosen in such that they matches with real world objects
• Objects take up spaces in the memory and have associated address
Object:student
DATANamemarks
FUNCTIONSTotal Display
Class
• When you define a class, you define a blueprint for an object
• Objects are variables of type class
• Once class is create,we can define any number of objects belonging that class
• Example: fruit is defined as a Class
• fruit f1: f1 is a object of class fruit
Class
• Class Box
• {
• Double length;//length of box
• Double breadth;//breadth of box
• Double height;//height of box
• }
Data Abstraction
• Data abstraction refers to, providing only essential information hiding their background details
• i.e., to represent the needed information in program without presenting the details
• Eg:database system hides certain details how data is stored and created and maintained
Data Encapsulation
• The wrapping up of data and functions into single unit called encapsulation
• Data is not accessible to outside world and only functions wrapped in class can access it
• Insulation of data from direct access by the program is called Data Hiding
Data encapsulation
• Class Box
• {public:
• Double getVolume()
• {
• Return length*breadth*height
• }
• Private: double length;
• Double height;
• Double breadth;
• }
Inheritance
• Inheritance is the process of forming a new class from an existing class
• The existing class called as base class, new class is formed called as derived class
• In OOP the concept of inheritance provide idea of reusability
• We can add additional feature to an class without modifying it
Person
Name: StringAddress: String
Employee
Company: StringSalary: double
Student
School: String
Base class
Derived classDerived class
Polymorphism
• Polymorphism means ability to take more than one form
• Poly refers to many
• This is an operation may exhibit different behavior in different instances
• Eg: for two numbers operation will generate an sum , for two strings operation will generate a third string by concatenation
Want to learn more about programming or Looking to become a good programmer?
Are you wasting time on searching so many contents online?
Do you want to learn things quickly?
Tired of spending huge amount of money to become a Software professional?
Do an online course @ baabtra.com
We put industry standards to practice. Our structured, activity based courses are so designedto make a quick, good software professional out of anybody who holds a passion for coding.
Follow us @ twitter.com/baabtra
Like us @ facebook.com/baabtra
Subscribe to us @ youtube.com/baabtra
Become a follower @ slideshare.net/BaabtraMentoringPartner
Connect to us @ in.linkedin.com/in/baabtra
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550
Cafit Square,Hilite Business Park,Near Pantheerankavu,Kozhikode
Start up VillageEranakulam,Kerala, India.
Email: [email protected]