C++ Programming - OOPS Concepts - Discussion
Discussion Forum : OOPS Concepts - General Questions (Q.No. 10)
10.
Which of the following concepts of OOPS means exposing only necessary information to client?
Discussion:
71 comments Page 4 of 8.
Richa said:
10 years ago
Correct answer is abstraction not data hiding.
Uday said:
1 decade ago
Data hiding means giving/revoking access members. Like access specifiers.
Eg: Public/private/protected. :).
Eg: Public/private/protected. :).
Suchita said:
1 decade ago
Abstraction is process of identifying key aspects of an entity and ignoring the rest. So answer should be abstraction.
Vipin P Mishra said:
1 decade ago
From my thinking abstraction is right answer because abstraction show only show essential information.
ROOPESH said:
1 decade ago
Encapsulation: The wrapping up of data and functions into a single unit is called encapsulation.
Abstraction: Abstraction refer to the act of representing the essential features without including the background details.
Data hiding: The data is not accessible to any other function except the function which is binding to that data.
So the answer is B (ABSTRACTION) not c.
Abstraction: Abstraction refer to the act of representing the essential features without including the background details.
Data hiding: The data is not accessible to any other function except the function which is binding to that data.
So the answer is B (ABSTRACTION) not c.
GAUTAM DEV said:
1 decade ago
Encapsulation means protecting data from other programmers in real programming world which can be achieved by the making data variable as private data. The private data variable can only be accessed inside the declared class if we want to allow to access the value to other programmers we provide the another way that is better and setter method for that private variable.
So by better and setter method we allow the another programmer to access the variable we doing this as Abstraction and When we declare the private methods which means we are doing encapsulation.
So by better and setter method we allow the another programmer to access the variable we doing this as Abstraction and When we declare the private methods which means we are doing encapsulation.
K2u2007 said:
1 decade ago
Declaring data members with access specifier private is known as data hiding. When a program creates a GradeBook object, data member courseName is encapsulated (hidden).
In the object and can be accessed only by member functions of the object's class. In class GradeBook, member functions setCourseName and getCourseName manipulate the data Member courseName directly.
In the object and can be accessed only by member functions of the object's class. In class GradeBook, member functions setCourseName and getCourseName manipulate the data Member courseName directly.
HINA said:
1 decade ago
According to me abstraction is the correct answer because abstraction focuses on the main aspect of the application and hide the internal details so that it will be more flexible for the user to use.
Aravind said:
1 decade ago
Write a simple single program to diff b/w data hiding and abstraction?
Ansuman kar said:
1 decade ago
The answer would be Abstraction not data hiding, because in abstraction only we show the user the necessary datas.
Further, if there is difference between abstraction and data hiding, hence provide me a suitable difference between the two.
Further, if there is difference between abstraction and data hiding, hence provide me a suitable difference between the two.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers