Showing posts with label oops. Show all posts
Showing posts with label oops. Show all posts

Friday, 27 June 2014

Basic Definition of Polymorphism in C++ with example.




Definition of Polymorphism in C++ with example.



The basic definition of polymorphism in C++ is 

Polymorphism is the property by which the message can be sent to objects of several different classes , and each can respond to it in a different way depending upon its class. In C++ Polymorphism is itemplemend through the basic concept called as overloading.



Example  of polymorphism


float a ( float b)
{
return b*b;
}
float a ( float b, float c)
{
return b*c;
}

Definition of Inheritance in C++ with Example.

 

Inheritance in C++ with Example.




Inheritance in C++ is basically the capability of one class to inherit properties from another class . For example , house is a class wherefrom class chiarhouse inherits as given below:


class house
{
protected:
char name[25];
int rollno;
public:
void  readhouse ();
void showhouse ();
};
class chairhouse: protected house
{
protected :
char tables[50];
public:
 void readchahou();
void showchahou();
};
 

What are the advantages of OOP in C++.




Advantages of OOP in C++.




The Basic advantages of OOPs  in C++ are 

1.Reusability of code 

2. Ease of comprehension

3. Ease of Fabrication and Maintenance .

4.  Easy redesign and extension

Thursday, 26 June 2014

What are objects implemented in the C++.



 Objects implemented in the C++.



The basic details like the object implemented in C++ as in terms of the software are



1. Characteristics/attributes are implemented through member variables or from the data items of the object.

2. Behaviour is also implemented through member functions called methods.

3. It is always given a unique name to give its identification.

Wednesday, 25 June 2014

Difference Between an Object and a Class in C++ .




An Object and  a Class in  C++

 The basic difference Between the Object and a Class in a C++ program is


Object 

An object is basically an identifiable entity with some characteristics and behaviour.

It also behaves as an entity that has the ability to store data and its associated functions.

Class 

A class in a C++ is basically a group of objects that share common properties and relationships.

And in another way can be said as a group of similar objects.




What are Object Oriented Programming and Procedural Prgramming in C++.




Object Oriented Programming and Procedural Programming in C++


The Basic Difference Between the Object Oriented Programming and Procedural Programming in C++  Is 



 Object Oriented Programming

1. Here the basic focus is on Objects.
2. This follows a Bottom - up approach in a program.
3.It's ability of data hiding feature prevents the accidental change in data.
4. The basic features of this type are data encapsulation,polymorphism and  inheritence.