Tutor HuntResources C Plus Plus Resources

Object Oriented Programming Language C++

Basic for Object oriented methodology

Date : 20/01/2016

Author Information

Jatin

Uploaded by : Jatin
Uploaded on : 20/01/2016
Subject : C Plus Plus

Let me start with class and object.

There is number of questions raise that what is class ? What is object? What is difference between class and object? How we can use class and object in real life?

How can we decided and based on what we can decided class?

Let me first represent OOP concepts:
Object oriented programming represents real world, what does it means?

It is something that whatever you can in world that is an object. Now how we can describe the each and every object?

Suppose you have seen one table in front of you , that is object , let us we describe it. Table will have height , width , type material used in it , it’s color ,table type ( eg. Dinning table), table owner, table manufacturer company Name.

table descri ption in real world using OOP

We can describe it using attribute or property of particular object.

Table ->height
->widht
->color
->typeofmaterialused
->tabletype
->manufacturer companyName

etc ......................

Similarly We can describe each and every object in real world
Let me Focus on Class:
Let first we can describe the class , As Name Class , we can say it is category , we can say it is group of something , we can say it is division

Let us see some example.

Suppose when you go for getting ticket for railway ,there will be different class will be there like first class ticket , second class ticket and third class ticket.

So it is first class categoty or class or group of first class people
Similarly for second class
And for third class

Let us see another example. Suppose when i am talking about person , it is collection of people or group people ,
Suppose person can be you, person can be me , person can be they.
So when we talk about person , at that time , one particular person can not come in mind. Only word person come in mind , you can not visualize any person in your mind. Becuase it is abstract , you can say it is more general , not specfic.


That means it is collection of people. That’s why it is class or category or group or division , whatever you can say it , But as far as C++ terminology is concern , we can say it is class It is also keyword or reserved in c++

Let us see number of Example:

Suppose shape

It is collect of shape , it is also abstract , it is word come in mind only , but when you talk about tringle or rectanle or square , it is come directly in mind , but shape can not visulize in your mind so it is abstract , so that’s why abstact class is not implemented , it is inherited by derived class , it is used by derived class object
Even we can not able to create object of abstract class , reason is that

It is virtual or in mind , we can create object of those ,whic is physically present

So abstract class is not physically present

This resource was uploaded by: Jatin