Search
 
SCRIPT & CODE EXAMPLE
 

CPP

abstraction in cpp

#include <iostream>
using namespace std;
  
class implementAbstraction
{
    private:
        int a, b;
  
    public:
      
        // method to set values of 
        // private members
        void set(int x, int y)
        {
            a = x;
            b = y;
        }
          
        void display()
        {
            cout<<"a = " <<a << endl;
            cout<<"b = " << b << endl;
        }
};
  
int main() 
{
    implementAbstraction obj;
    obj.set(10, 20);
    obj.display();
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: exponent of x using c c++ 
Cpp :: preorder 
Cpp :: online ide c++ 
Cpp :: c++ forbids comparison between pointer and integer 
Cpp :: selection sort c++ 
Cpp :: C++ Pi 4 Decimal 
Cpp :: find positive number factorial in C++ 
Cpp :: ue4 c++ replicate actor variable 
Cpp :: how to make a vector in c++ 
Cpp :: oncomponentendoverlap ue4 c++ 
Cpp :: loop execution descending order in c++ 
Cpp :: program to swap max and min in matrix 
Cpp :: how to traverse through vector pair 
Cpp :: what is function c++ 
Cpp :: Operators in C / C++ 
Cpp :: c++ add input in 
Cpp :: bit++ codeforces in c++ 
Cpp :: if else in c++ 
Cpp :: DS1302 
Cpp :: time complexity of best sort algorithm 
Cpp :: C++ vector structure 
Cpp :: if not c++ 
Cpp :: abs c++ 
Cpp :: c++ main function parameters 
Cpp :: deque 
Cpp :: C++ programming code to remove all characters from string except alphabets 
Cpp :: using-controller-and-qt-worker-in-a-working-gui-example 
Cpp :: how to do if command in c++ 
Cpp :: convert hex to decimal arduino 
Cpp :: nmake.exe is not found in the windows 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =