Sunday, 5 May 2013

Abstract Class Example


abstract class One{

public function disp(){

echo "Inside the parent class
";

}

}

class Two extends One{

public function disp(){

echo "Inside the child class
";

}

}

class Three extends One{

//no method is declared

}

$two=new Two();

echo "Calling from the child class Two:
";

$two->disp();

echo "Calling from the child class Three:
";

$three=new Three();

$three->disp();

?>