A class is a blueprint for creating objects
An objects is refer to instance by which we can access all the property and methods of CLASS.
Encapsulation
Abstruction
Polymorphisom
Inheritance
Encapsulation
Hides the complexity and present essential features without including the background implementation
Several ways to achieve abstraction in OOP
Encapsulation
Combines properties and method in same object
Encapsulation
Allows code re-use by creating parent and child relationship.
Share a set of attribute and method between parent and child class
Encapsulation
The ability to appear in many forms
Two types :
Adds dynamic nature and flexibility in code
Encapsulation
Encapsulation
An interface defines a public API, nothing is private about it. It's like a contract
A class to implement an interface called can-do (or -able ).
Interface enforce certain properties on an object (class)
Encapsulation
An interface is pure form of abstraction
An abstract class is a compromise between Abstraction and Concrete implementation.
Example :
- Interface: Barkable, Runable, Flyable, Swimable.
- Abstract Animal class and the sub class: Bolt, angrybird and Nemo.
- Abstract class and the sub class Machine: McQueen, Siddeley.
Encapsulation
All Images are taken from online
You can checkout this blog
Plenty of resources out there, so feel free to search and give away of your confusion about any topics
Encapsulation
Encapsulation
name : Emran Ul Hadi,
find-me : emran.github.io
photo :