Today i heard from my friend, that encapsulation is not only achieving information hiding but also abstraction. How does it achieve?
public class employee {
I don't think you can prove encapsulation with that particular example. It's more like this:
interface NameService { String getName(); }
Now, tell me: does a class implementing this interface get the name from a flat file, a database, a nosql store, or someplace else?