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.
Encapsulation is hiding the data within the classes by providing public methods to manipulate the data,we declare the variables as private and provide public methods to manipulate from outside.