function overriding

<?php

/*Function Override is that when child class contain same method or function whatever you say that also in the parent class … then what hapen if programmer made an object of class candy that extends the bingo class and call the showup() function that exist in both class …??

Okay ,, as the programmer create an object of candy class and candy class extends the bingo class then the showup() function will called from candy class … This is actually known as function overriding …*/
class bingo
{
function showup()
{
echo “This is Bingo’s show!!”;
}
}
class candy extends bingo
{
function showup()
{
echo “This is Candy’s show!!”;
}
}

$object = new candy();
$object -> showup();
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s