Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between abstraction, encapsulation and data hiding?

0
Posted

What is the difference between abstraction, encapsulation and data hiding?

0

Submitted by: venkat J Abstraction and encapsulation are two quite separate concepts in Java. Abstraction is a technique that is used to represent common functionality amongst a set of classes. An analogy is to look at a set of vehicles: Car, Truck and Bus have some common features that all road vehicles share. From a Java perspective, the mechanics of turning four wheels, an engine, could be handled in abstract form through a common super class. Abstraction allows subclasses to share common code without duplication.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123