PHP Training in Chandigarh (20) - PowerPoint PPT Presentation

About This Presentation
Title:

PHP Training in Chandigarh (20)

Description:

PHP Training in Chandigarh is the best place to learn about PHP coding . OOPs Concepts in PHP is Very important and mostly used . Learn PHP Inheritance by Watching this Presentation – PowerPoint PPT presentation

Number of Views:25

less

Transcript and Presenter's Notes

Title: PHP Training in Chandigarh (20)


1
PHP Training in Chandigarh
  • CBitss Technologies

2
Object Inheritance
  • Inheritance is a well-established programming
    principle, and PHP makes use of this principle in
    its object model. This principle will affect the
    way many classes and objects relate to one
    another.
  • For example, when you extend a class, the
    subclass inherits all of the public and protected
    methods from the parent class. Unless a class
    overrides those methods, they will retain their
    original functionality.

3
(No Transcript)
4
How can a child class have its own methods and
properties?
  • ust as a child class can use the properties and
    methods of its parent class, it can have
    properties and methods of its own as well.
    However, while a child class can use the code it
    inherited from the parent, the parent class is
    not allowed to use the child classs code.
  • In the example given below, we will add to the
    child class some code of its own by adding the
    style property as well as the driveItWithStyle()
    method

5
  • The parent class has its properties and
    methodsclass Car //A private property or
    method can be used only by the parent. private
    model // Public methods and properties can
    be used by both the parent and the child
    classes. public function setModel(model)
    this -gt model model public
    function getModel() return this -gt
    model

6
CBitss Technologies SCO 23-24- 25, Level 3, Near
Passport office, Sector 34 A, Chandigarh. Contact
Us- 9914641983.
Website- http//cbitss.in/php-training-in-chandig
arh/
7
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com