Java – The basics

The three principals of OOP are as follows: Encapsulation is the simplest of all. It means that data of the object and operations on the data are packaged together in one class. Inheritance lets us base a new class on existing one, where we choose common functionality. Java includes 2 types of inheritance. Implementation : With this the subclass includes…