JAVA - Abstraction

前端 未结 9 2104
旧巷少年郎
旧巷少年郎 2021-01-15 04:29

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

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-15 05:15

    I think you are confused about two things

    1. Abstract concept in OOPs and its implementation in Java
    2. abstract class in java

    3. 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

    4. 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

提交回复
热议问题