Don't repeat the code its a main concept of OOPS language
four pillar of OOPS
Public -> Can be access from anywhere
Private -> Declared on Class level, can't be inherit
Protected -> Accessible only for the direct child
Constructor in PHP:-
If we switch On button then Television is getting on its our primary focus, don't need to worry what is happen its behind.
Polymorphism:-
db.php is the example of this one function accepts the diff parameters
Encapsulation:-
Class Shaktiman extends human
implements flying
implements runable
implements growable
Class Arjun extends human
implements bhramashtra
four pillar of OOPS
- Abstraction
- Polymorphism
- Encapsulation
- Inheritance
Public -> Can be access from anywhere
Private -> Declared on Class level, can't be inherit
Protected -> Accessible only for the direct child
Constructor in PHP:-
- PHP use another constructor __Constuctor()
- There should be only 1 constructor in PHP
- Constructor is created by its own
- constructor is the first function of the object
- Make some ideal code and use that further
- To define rules and regulations
- Data hiding
- Essential data is hidden
- If we extend the parent class then we must redefine all the abstract methods of abstract parent class
If we switch On button then Television is getting on its our primary focus, don't need to worry what is happen its behind.
Polymorphism:-
- One thing has many form
- Function Overloading is the example of this
db.php is the example of this one function accepts the diff parameters
Encapsulation:-
- To give permission to meet code
- Assign permission to meet code
- Assign Permission to meet data
- Public, Private, Protected
- Interface are extra methods and properties which we need to assign to class
- Multiple is possible with the help of Interface.
- All the useful methods and variables are assigned inside the Interface
Class Shaktiman extends human
implements flying
implements runable
implements growable
Class Arjun extends human
implements bhramashtra