Welcome to pickSourcecode.com Login | Register    
pickZy.com
 Home  | search  | games  | General  | C  | C++  | Java  | Php  | Networking  | Visual Basic  | VC++  | Win32  | MFC  | JavaScript  | Jobs  | JavaScript  | Post jobs
Basic concepts of OOPS and Structure of C++ program       Share
2008-10-14 |  sudhadevaraj  | Viewed: 735  |    0

Basic concepts of OOPS and Structure of C++ program:

Be
fore starting to learn C++ it is essential that one must have a basic knowledge of 
the concepts of Object oriented programming. Some of the important object oriented 
features are namely: 

• Objects 
• Classes 
• Inheritance 
• Data Abstraction 
• Data Encapsulation 
• Polymorphism 
• Overloading 
• Reusability 
In order to understand the basic concepts in C++, the programmer must have a command 
of the basic terminology in object-oriented programming. Below is a brief outline of 
the concepts of Object-oriented programming languages:

Objects: 

Object is the basic unit of object-oriented programming. Objects are identified by 
its unique name. An object represents a particular instance of a class. There can be 
more than one instance of an object. Each instance of an object can hold its own 
relevant data.
  
An Object is a collection of data members and associated member functions also 
known as methods. 

Classes: 

Classes are data types based on which objects are created. Objects with similar 
properties and methods are grouped together to 
form a Class. Thus a Class represent 
a set of individual objects. Characteristics of an object are represented in a class 
as Properties. The actions that can be per
formed by objects becomes functions of the 
class and is referred to as Methods.
For example consider we have a Class of Cars under which Santro Xing, Alto and 
WaganR represents individual Objects. In this context each Car Object will have its 
own, Model, Year of Manufacture, Color, Top Speed, Engine Power etc., which 
for
Properties of the Car class and the associated actions i.e., object functions like 
Start, Move, Stop 
form the Methods of Car Class.
No memory is allocated when a class is created. Memory is allocated only when an object
 is created, i.e., when an instance of a class is created. 

Inheritance: 

Inheritance is the process of 
forming a new class from an existing class or base class.
 The base class is also known as parent class or super class, The new class that is 
formed is called derived class. Derived class is also known as a child class or sub 
class. Inheritance helps in reducing the overall code size of the program, which is an 
important concept in object-oriented programming. 

Data Abstraction: 

Data Abstraction increases the power of programming language by creating user defined 
data types. Data Abstraction also represents the needed in
formation in the program 
without presenting the details. 

Data Encapsulation: 

Data Encapsulation combines data and functions into a single unit called Class. When 
using Data Encapsulation, data is not accessed directly; it is only accessible through 
the functions present inside the class. Data Encapsulation enables the important concept
of data hiding possible.
 
Polymorphism: 

Polymorphism allows routines to use variables of different types at different times. 
An operator or function can be given different meanings or functions. Polymorphism 
refers to a single function or multi-functioning operator per
forming in different ways. 

Overloading: 

Overloading is one type of Polymorphism. It allows an object to have different meanings,
 depending on its context. When an exiting operator or function begins to operate on 
new data type, or class, it is understood to be overloaded. 

Reusability: 

This term refers to the ability 
for multiple programmers to use the same written and 
debugged existing class of data. This is a time saving device and adds code efficiency 
to the language. Additionally, the programmer can incorporate new features to the 
existing class, further developing the application and allowing users to achieve 
increased per
formance. This time saving feature optimizes code, helps in gaining 
secured applications and facilitates easier maintenance on the application. 


Latest topics
The Preprocessor  Viewed: 303
Type Casting  Viewed: 306
What is conversion constructor?  Viewed: 311
Input/Output Library  Viewed: 314
Definition of OOP:  Viewed: 315
Objects  Viewed: 316
What is Multiple Inheritance?  Viewed: 321
What is Message passing  Viewed: 327
Differentiate between the message and method?  Viewed: 332
What are C++ storage classes?  Viewed: 333

Comments:





Submit comment's

Type:

User Comment's:

Submitted By:
Prof: Software
Tech: C ,Cpp
Send Mail: jmcdoss_05



Related topics
Cpp - c++ interview tips
Cpp - c++ Destructors
What is Encapsulation?
What is Data Abstraction?
What is Inheritance?
What is Polymorphism?
What is Message passing
What is Extensibility?
What is Persistence?
What is Delegation and Genericity?
What is Multiple Inheritance?
Basic concepts of OOPS and Structure of C++ program
what is memory leak?how to avoid that?
When are copy constructors called?
What are all the implicit member functions of the class?

Related References
cpp - pointers in c++
cpp - how to use dll file in the c++ program
cpp - creating and linking dll files to c++ program
cpp - append c++
fibonacci series - c++ - cpp
c++ - factorial sample program
binary search cpp program , c++ samples and tutorials
cpp lexicographical_compare sample program
reversecompare cpp example

Web site contents © Copyright 2007, All rights reserved.
Help | Terms and Conditions | Privacy Policy | About Us