I am little confused about abstraction in java.
I have checked many pages stating that abstraction is data hiding(Hiding the implementation).
What I understa
In Object oriented programming Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words user will have the information on what the object does instead of how it does it.
check the following link for more details: http://www.visionsdeveloper.com/tutorial/java/java-abstraction.jsp
I think you are confused about two things
abstract class in java
Abstract : There is OOPs concept called Abstract. Here, user can capture necessary features of an object. This abstract concept implemented as class and object in java. So, coming to you question, data hiding, when you capture important features of an object in the form of class those features are accessible only to their own class's object. Here, you are hiding all features of a class from outside the class/world. So, it is called as data hiding
abstract class : This is the feature of the Java implementation. If you don't know complete implementation then you can go for abstract class of java.
Hope this helps you to understand a little
Thanks
Data hiding is when you cannot understand how to work API internally (for example, ArrayList
) without reading the documentation. API creators don't provide any access to the array that underlies there.
You hide API implementation from users that will be used it. They shouldn't worry about how it works internally, they are only interested in the functionality which is provided to them.
There is a good article about that.