Introduction of C++


Introduction of object-oriented programming language: 



  Here we teach about C++ for beginners and professionals.  C++ is an object-oriented programming language. It is an extension to C programming.

Object oriented programming language is a programming language in which classes and objects are used to write a program.

Our C++ tutorial includes all topics of C++ such as first example, control statements, objects and classes, inheritanceconstructor, destructor, this, static, polymorphism, abstraction, abstract class, interface, namespace, encapsulation, arrays, strings, exception handling, File IO, etc.


 Aspects of object-oriented programming 

1. Class:-  Class is a just a template which contain attribute and function .It’s syntax is given   below

class    class-name 

data:

function()

{

}

 2Object: - Object is a instant of class, if class is a data type then object is a variable of that  data  type.        

                                 A class can have many objects unless a class is a singleton class.         

Every object contains data and function. A class is a just a template when data and function are defined. Data are defined in the outer with the help of objects. Memory is not created unless a object is created. 

 Nature of objects    

a. Natural object.  For example: -human, river, ocean, mountain, etc

b. Artificial object  for example:-bench, desk, book, etc  

c. Business object for example: -Employ, owner, service, etc

d. product of object for example: -biscuits, bread, etc


3. Inheritance: -A child class can derived all the attribute and function of parent class, this  process is called inheritance.
It increases reusability of the code that means code written in one class can be transfer into another class. 

4. Polymorphism:-  Poly means many and morphism means form. If we define a function and  if we  use the function differently in outer world then this process is called polymorphism.
FOR EXAMPLE: 
shape 
  {
👴
 } 
shape 
{
 Δ 
  } 
shape 
0

All the function has same name but different internal architecture. Which means function name is same but use differently in outer world.

5. Encapsulation: -  Encapsulation is the process in which attributes and function of one (1) object are encapsulated at 1 place. 
FOR EXAMPLES: 

      Class A 


  int a, b, c; 

void main () 

}; 
6. Abstraction: -    Abstraction is the process of hiding internal details from the outer world. Abstraction means internal details are hidden from the user and necessary information are provided to the user. 

FOR EXAMPLES:  If we press the switched, we don’t know how it works internally, the internal work is hidden from users. 

  

 

 

 

 

1 comment:

theengineerschoice01@gmail.com