<?php
echo "<br/>Method OverRidding supporting example<br/>";
class A {
public function fun1($rec)
{
echo "Parent : ".$rec."<br/>";
}
}
class B extends A
{
public function fun1($rec)
{
echo "Child : ".$rec."<br/>";
}
}
$oA=new A();
$oB=new B();
$oA->fun1('Passing value to parent');
$oB->fun1('Passing Value to Child');
?>
echo "<br/>Method OverRidding supporting example<br/>";
class A {
public function fun1($rec)
{
echo "Parent : ".$rec."<br/>";
}
}
class B extends A
{
public function fun1($rec)
{
echo "Child : ".$rec."<br/>";
}
}
$oA=new A();
$oB=new B();
$oA->fun1('Passing value to parent');
$oB->fun1('Passing Value to Child');
?>
0 comments:
Post a Comment