Having a confusion between
Final in PHP.
For example I have 3 classes:
- Class A (parent class)
- Class B (child class)
- Class C (other class)
What I understand:
- A: Public variables and methods are accessible to the class A, class B and class C
- B: Private variables and methods are only accessible to the class A.
- C: Protected variables and methods are only accessible to the class A and class B
- D: Final methods are only accessible to the class A not to class B.
My Question is:
After using private we can achieve functionality like final then why we use final?
I am asking this question only for my clarification for myself.