java abstraction and encapsulation

How is Abstraction different from Encapsulation?

Abstraction happens at class level design. It results in hiding the implementation details. Encapsulation is also known as “Information Hiding”.

An example of encapsulation is marking the member variables private and providing getter and setter for these member variables.

猜你喜欢

转载自www.cnblogs.com/longchang/p/10648340.html
今日推荐