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
You are going to get access to the code once you implement the class/interface and you will modify it according to your need.
I guess you are little confused about the concepts which language gives you like Abstraction here. You always have access to your own code but the things like Abstraction OR Polymorphism gives you the ideal ways which things must be. So in Abstraction you are just saying I know there will be a behavior having name someThing as abstract method but right now you dont know how it will behave, The implementer will tell us how this will be. See following code.
abstract class Game{
public abstract void play();
}
class Football extends Game{
@Override
public abstract void play(){
// write how football play
}
}
class Cricket extends Game{
@Override
public abstract void play(){
// write how Cricket play
}
}
I am here leaving a question for you.
Why you are making class level attributes public/protected/private although you have access to the code when you implement?