what is data hiding.

Answer Posted / arvind

Data & Functions in C++ are private by default. That means there is no previlige outside the class. The functions or objects defined outside the class can't access the data and functions.So by making data and functions private with in the class, its making the data hiding and function hiding. By default data is private and functions are public. So this is the concept of data hiding

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is class defined?

588


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1661


How to call a non virtual function in the derived class by using base class pointer

5281


How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction

1656


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1944






What does sksksk mean in text slang?

1541


How is polymorphism achieved?

587


What is the main purpose of inheritance law?

673


What is cohesion in oop?

624


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1992


what is the drawback of classical methods in oops?

2922


How do you achieve runtime polymorphism?

573


can inline function declare in private part of class?

3662


Why is there no multiple inheritance?

572


What is polymorphism and why is it important?

562