UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is encapsulation in C++?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

Make your future bright with me!!!

Encapsulation in C++ is defined as the wrapping up of data and information in a single unit. In Object Oriented Programming, Encapsulation is defined as binding together the data and the functions that manipulate them.
Comments

I have 10 years experience in teaching C, C++, Java, Python, tally, Ms-Excel, SQL.

Encapsulation is Normally private variable cannot be accessed from outside the class. That it is hidden from users. If you want others to read or modify the value of a private variable, you can provide public get and set methods. This get and set method working in Encapsulation. Ex: class Emp { private: int...
read more

Encapsulation is Normally private variable cannot be accessed from outside the class. That it is hidden from users. If you want others to read or modify the value of a private variable, you can provide public get and set methods. This get and set method working in Encapsulation.

Ex:

class Emp {

private:

int sal;

public:

void setSal(int s)

{ sal = s; }

int getSal()

{ return sal; }

};

void main()

{ Emp Obj1;

Obj1.setSal(100000);

cout << Obj1.getSal();

read less
Comments

Experienced Computer trainer having worked in IT sector for 20 years.

Encapsulation in C++ is defined as the wrapping up of data and information in a single unit. In Object Oriented Programming, Encapsulation is defined as binding together the data and the functions that manipulate them.
Comments

View 1 more Answers

Related Questions

Which language is best, C, C++, Python or Java?
If you want to learn any languages C#, Java, ect. then must to learn C, C++ language as these are base or language to be strong in language skills. C++ is improved version of C language. C#, Java, J# and etc. which are improved version of C++.
Sribaghya
0 0
6
What is called 'nested loops' in C++?
These are those loops in which one loop executes inside another loop. For example for loop for(int i=1,i=10,i++) { for(int j=1, j<=i,j++) { } } the second loop is the nested for loop.
Harikrishnan
What is Enum
An enumeration is a set of named integer constants. An enumerated type is declared using the enum keyword. C# enumerations are value data type. In other words, enumeration contains its own values and cannot inherit or cannot pass inheritance.
S
Why c++ introduced reference variable?
C++ references allow you to create a second name for the a variable that you can use to read or modify the original data stored in that variable.
Sunita
What is difference between object oriented procedure and object oriented programming?
i.basic building block for procedure orientation is functions while for OOPS its objects.. ii.pop follows top-down hierarchy while opps its just opposite. iii.pop lacks encapsualtion and has acesses...
Madhuranjan

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Swapping Two Numbers
Q. Swap two numbers using the following function. Complete the function. You won't be allowed to use a temporary variable to swap the two numbers. void swap ( ... ) { /* Swap code goes here */ } ...

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

Polymorphism and Virtual Functions
Polymorphism and Virtual Functions Compile Time Polymorphism or Early Binding or Static Binding An object is bound to its function call at compile time. Implemented using overloaded functions and...

C++ Program-Working with constant using const keyword
//Header files #include<iostream.h>#include<conio.h> //Main function void main(){ //using const keyword to declare constants with a specific type const int len=10; const int br=5; const...

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more