OOP Stands For Object-Oriented Programming
OOP Stands For Object-Oriented Programming
Abstraction:
Data abstraction is the process of hiding certain details and showing only
essential information to the user.
Abstraction can be achieved with either abstract classes or Interfaces
The abstract ket word iis a non-access modifier, used for classes and
methods:
// Regular method
class Main {
myPig.animalSound();
myPig.sleep();
Encapsulation:
this.length = length;
this.breadth = breadth;
}
// method to calculate area
class Main {
rectangle.getArea();
For example, think of a superclass called Animal that has a method called
class Area {
int length;
int breadth;
this.length = length;
this.breadth = breadth;
class Main {
rectangle.getArea();