20

Oop concepts

Embed Size (px)

Citation preview

Page 1: Oop concepts
Page 2: Oop concepts

Neethu.T

[email protected]

Neethu thottath

neethoosT

Neethu.Neethoos

21wpm

OOP CONCEPTS

Page 3: 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

Page 4: Oop concepts

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

Page 5: Oop concepts

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

Page 6: Oop concepts

Basic concepts of OOP

• Objects

• Class

• Data abstraction

• Data Encapsulation

• Inheritance

• Polymorphism

Page 7: Oop concepts

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

Page 8: Oop concepts

Object:student

DATANamemarks

FUNCTIONSTotal Display

Page 9: Oop concepts

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

Page 10: Oop concepts

Class

• Class Box

• {

• Double length;//length of box

• Double breadth;//breadth of box

• Double height;//height of box

• }

Page 11: Oop concepts

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

Page 12: Oop concepts

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

Page 13: Oop concepts

Data encapsulation

• Class Box

• {public:

• Double getVolume()

• {

• Return length*breadth*height

• }

• Private: double length;

• Double height;

• Double breadth;

• }

Page 14: Oop concepts

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

Page 15: Oop concepts

Person

Name: StringAddress: String

Employee

Company: StringSalary: double

Student

School: String

Base class

Derived classDerived class

Page 16: Oop concepts

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

Page 17: Oop concepts
Page 18: Oop concepts

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.

Page 19: Oop concepts

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

Page 20: Oop concepts

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]