C++(oop)| Fundamentals | Concepts||

 PROGRAMMING CODESTER 

Concepts of OOP(c++) 


Hello wonderful people!


Fill in the blank:

#include<iostream>

int main()

{

        ______cout<<"hello world";

}


c++ basic structure explanation: watch the video


On your request I started c++ means oop(object oriented programming) series with C programming! 

So, this is very basic fundamentals of oop concept and its first tutorial of oop 

So, I hope you learn! 

Let's start!! 

Today's topics: 

  • Introduction to OOP 
  • Procedural Vs. Object Oriented Programming 
  • Principles of OOP 
  • Benefits and applications of OOP 

1.Introduction to OOP 

  • OOP is a design philosophy. It stands for Object Oriented Programming.  
  • C++ was founded in (1983) 
  • Object-Oriented Programming (OOP) uses a different set of programming languages than old procedural programming languages like (C, Pascal, etc.). 
  •  Everything in OOP is grouped as self-sustainable "objects". 

 

2.Applications of OOP 

  1. Real Time Systems Design 
  2. Simulation and Modeling System 
  3. Object Oriented Database 
  4. Client-Server System 
  5. Neural Networking and Parallel Programming 
  6. Decision Support and Office Automation Systems 
  7. CIM/CAD/CAM Systems 
  8. AI and Expert Systems 

 

Procedural Vs. Object Oriented Programming 

 

 

 

Principles of OOP (A.E.I.P) 

There are mainly four OOP Principles 

  • Abstraction 
  • Encapsulation 
  • Inheritance 
  • Polymorphism 

  •  

Abstraction 

Abstraction refers to the act of representing essential features without including background details or explanations. 

 Abstraction provides you with a generalized view of your classes or object by providing relevant information. 

Abstraction is the process of hiding the working style of an object and showing the information of an object in an understandable manner. 

Example: 

If somebody in your college tells you to fill in the application form, you will fill in your details like name, address, date of birth, which semester, percentage you have got etc.  

If some doctor gives you an application to fill in the details, you will fill in the details like name, address, date of birth, blood group, height and weight. 

See in the above example what is the common thing Age, name, address so you can create the class which consist of common thing that is called abstract class. 

That class is not complete, and it can be inherited by other class. 

    

Encapsulation 

  • The wrapping up of data and functions into a single unit is known as encapsulation. 

  •  The insulation of the data from direct access by the program is called data hiding or information hiding. 

  •  It is the process of enclosing one or more details from the outside world through access rights. 

 

  • Abstraction is a process where you show only “relevant” data and “hide” unnecessary details of an object from the user. 

  •  Consider your mobile phone, you just need to know what buttons are to be pressed to send a message or make a call, what happens when you press a button, how your messages are sent, how your calls are connected is all abstracted away from the user. 

  • Encapsulation is the process of combining data and functions into a single unit called class. 

  •  In Encapsulation, the data is not accessed directly; it is accessed through the functions present inside the class. 

  • Users are unaware about the working of circuitry and hardware devices. 

  

Abstraction Vs Encapsulation 

  

Abstraction says what details to be made visible & Encapsulation provides the level of access right to those visible details. 

  

Example:  

When we switch on the Bluetooth, I am able to connect another mobile but not able to access the other mobile features like dialing a number, accessing inbox etc. This is because, Bluetooth feature gives some level of abstraction. 

  

Abstraction Vs Encapsulation 

  

When mobile A is connected with mobile B via Bluetooth whereas mobile B is already connected to mobile C then A is not allowed to connect C via B. This is because of accessibility restriction. 

Inheritance 

  

Inheritance is the process by which objects of one class acquire the properties of objects of another class. 

 Here Vehicle class can have properties like Chassis no., Engine, Color etc. 

 All these properties inherited by sub classes of vehicle class. 

  

Polymorphism 

  

Polymorphism means the ability to take more than one form. 

For example, the operation addition. 

For two numbers the operation will generate a sum. 

If the operands are strings, then the operation would produce a third string by concatenation. 

 

So, guys, I hope you learn from this tutorial! 

I also uploaded basic program “Hello world” with c++ in my YouTube channel! 

I mentioned here! Check it out!! 

C tutorials: 

Thankyou for your support! 

Learn and explore! 

 

 

 

 

Comments

Popular posts from this blog

C programming | Printf and scanf ||

C programming | structure | Fundamentals of Structure

C programming | Fundamentals & Basic information

Basic question related programming || c programming || embedded programming

C++ || Operators with c++

C++ || string with c++ || Part - 1

Compiler & Interpreter | difference and explanation

c++|operators with c++|variables||

C programming | Nested structure | Array, function and pointer of structure|| structure Part-II