What is encapsulation?

Answer Posted / rahul

Encapsulation can be described as a protective barrier
that prevents the code and data being randomly accessed by
other code defined outside the class.
Encapsulation is the technique of making the fields in a
class private and providing access to the fields via public
methods. If a field is declared private, it cannot be
accessed by anyone outside the class, thereby hiding the
fields within the class. For this reason, encapsulation is
also referred to as data hiding.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the oops and benefits of oops programming?

558


What is purpose of inheritance?

645


What are the two different types of polymorphism?

677


Why oops is important?

616


What is object in oops?

617






What is destructor in oop?

627


What is static modifier?

636


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

2150


State what is encapsulation and friend function?

703


Why is there no multiple inheritance?

572


What is inheritance in simple words?

629


What is polymorphism and why is it important?

562


What is the problem with multiple inheritance?

588


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

944


Plese get me a perfect C++ program for railway/airway reservation with all details.

3431