-
Member
Inheritance In Php ?
Hello Dear,
Please Tell Me What Is Inheritance In Php ?
-
Member
Is this useful / helpfull?
Yes |
No
Inheritance is very useful if we want to create several similar classes. We can put the common properties and methods in one parent class and then inherit it in the child classes.
-
Member
Is this useful / helpfull?
Yes |
No
With inheritance we can create child classes that are based on the parent class.
A child class inherits all the properties and methods of its parent, and it can also add additional properties and methods.
PHP supports single & multilevel inheritance:-
.It does not support multiple inheritance.
.In single inheritance, by using the extend keyword a class can inherit methods and members of another base class (only one).
.PHP uses the concept of inheritance only in the object model.
.If a class extends another then the parent class is to be declared before the child class.
.The classes must be defined before they are used.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Protected by : ZB
BLOCK & StopForumSpam
Bookmarks