Exforsys.com
 

Sponsored Links

C++ Tutorials

 
Home Tutorials C++
 

Object Oriented Programming Paradigm

 

Object Oriented Programming Paradigm


Oops is a better way of solving problems in computers compared to the procedural language programming such as in C. oops is designed around the data being operated upon as opposed to the operations, these operations are designed to fit data.



A type of programming in which programmers define not only the data type of a data structure, but also the types of operations that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.


One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify.


To perform object-oriented programming, one needs an object-oriented programming language such as Java C++ etc.


The C++ programming language provides a model of memory and computation that closely matches that of most computers. In addition, it provides powerful and flexible mechanisms for abstraction; that is, language constructs that allow the programmer to introduce and use new types of objects that match the concepts of an application.


Thus, C++ supports styles of programming that rely on fairly direct manipulation of hardware resources to deliver a high degree of efficiency plus higher-level styles of programming that rely on user-defined types to provide a model of data and computation that is closer to a human’s view of the task being performed by a computer. These higher-level styles of programming are often called data abstraction, object-oriented programming, and generic programming.


Features of OOPs are the following:


  • Encapsulation
  • Data abstraction
  • Inheritance
  • Polymorphism
  • Message passing
  • Extensibility
  • Persistence
  • Delegation
  • Genericity
  • Multiple Inheritance


In the next tutorial we will discuss about these features.



Read Next: Elements of Object Oriented Programming



 

 

Comments


Manish Madhukar said:

  One Can make More Than one type of class in c . These are
1. Public class 2. Private class 3.friend class
Classes are useful to implement inheritance in C . A child class can contain all the properties i.e. attributes of a
Parent class. More attribute can be added to the child class to make a specialised class of its parent class.
ex: If Bird is a class then crow is a bird having some specific attributes by which it can be identified among other bird categories .
Here in above example bird is a parent class and the crow is a child class. In this way the property of INHERITANCE is implemented in the language of c .
Again, Bird is a case of GENERaLISATION while Crow is a case of SPECIALISATION. In this way DATA MODELING can be done in C .
A class contains its DATA MEMBERS as well as MEMBER FUNCTIONS. Various types of rules can be implemented to take the advantage of ENCAPSULATION. A Data Member is Private or Public or Protected.

INHERITANCE may be SINGLE INHERITANCE of MULTIPLE INHERITANC.
In the Single Inheritance Class can inherit one parent class while in case of MULTIPLE Inheritance class can Inherit more than one Class.
The Visibility of a class is also very important. A class can be a derived class. A Base Class Should be there.
If the BASE CLASS is PRIVATE then \'no\' Inheritance can be posible for Derived Class whether it is Public/Protected/Private.
A simple Program is being given To READ and DISPLAY data.
#include
#include
Class EMP
{
Char name[30];
int age;

public:
void getdata(void);
void putdata(void);
};
void EMP :: getdata(void)
{
coutname;
coutage;
void EMP :: putdata(void)
{
cout: \"}
void main()
{
EMP mm; /*comment: To Declare a instance of the class EMP. */

mm.getdata();
mm.putdata();

}

output Screen will be :--
Enter Name: Manish
Emter Age : 30

Name: Manish
Age: 30

This is completes the program run once.
July 6, 2006, 10:11 am

Manish Madhukar said:

  :\'( I have posted some comment yesterday but no new comment is there.
July 8, 2006, 1:35 pm

Raghunath said:

  Hi Manish...

It is really nice piece of information...The information is short and sweet...

Best regards,
Raghunatjh
June 10, 2007, 9:18 pm

VInesh said:

  Hi Manish!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This is really good thing you r doing can you put more focus on classes, objects and methods.

that will really help me...........

Thanks,

Regards,
Vinesh
October 29, 2007, 6:14 am

VInesh said:

  Hi Manish!!!!!!!!!!!!!!!!!!!!!

This is really nice thing, it is really easy to understand.
Can you please put more focus on Methods, Classes and objects, it will really help to know more on this.

Thanks,

Regards,
Vinesh
October 29, 2007, 6:19 am

praveenjnrbgm said:

  Hi Manish...

It is really nice of information...The information is short and sweet..I realy got some information.

Best regards;
From:PRAVEEN
December 11, 2007, 8:05 am

jainy said:

  It is really nice of information...The information is short and sweet..I realy got some information.
December 30, 2007, 8:16 am

Karthikakil said:

  I really got something in oops concept in c .........Thanks a lot..........
July 24, 2008, 8:59 pm

RAJA said:

  this is very very nice .it is easy to understand...
and is very useful at the time of examination.....

thank u...
best regards
Arun


October 22, 2008, 9:16 am

AVINASH said:

  it is very usefull & easily unerstadable notes.
November 13, 2008, 9:16 am

Nidhi said:

  an unsigned integer can be twice as large as signed integer.why?
December 14, 2008, 2:31 am

girish said:

  it is reliable and easy to understand and easy to write and modify the code.
January 28, 2009, 3:12 am

Jogendra kumar said:

  hiiii;
Manish you gave a good thing but i could not understood the conccept of derived class & their inheritence nature towards base class
January 30, 2009, 7:47 pm

sukant said:

  Good info easy to understand
February 5, 2009, 7:32 pm

chand said:

  Shashi you gave a good thing but I could not understand the conccept of derived class & their inheritence nature towards base class.
April 4, 2009, 1:50 pm

vnd said:

  signed integer uses one bit for sign but unsigned integer uses this extra bit for itself(as there is only + sign)this makes the largest value it can hold to almost double as compared to signed integer(2^32 = 2* 2^31 as for 4 byte integer)
June 17, 2009, 8:47 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape