Computer Science, asked by isha5315, 10 months ago

How do we implement polymorphism and encapsulation in java?​

Answers

Answered by Anonymous
2

Hii there

here is your answer

Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. ... Declare the variables of a class as private. Provide public setter and getter methods to modify and view the variables values.

HOPE IT HELPED U

PLZ MARK AS BRIANLIEST

Similar questions