My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Tuesday, 28 August 2018
Inheritance in PHP
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>OOP-2</title>
</head>
<body>
<?PHP
class books
{
var $title; // member variable.....
var $price ; // member variable.....
function setTitle($para)
{
$this->title=$para;
} //set method.....
function getTitle()
{
echo $this->title."<br/>";
} //get method.............
//...............................................
function setPrice($para)
{
$this->price=$para;
} //set method.....
function getPrice()
{
echo $this->price."<br/>";
} //get method.............
} //class end...................
class Novel extends books
{
var $publisher;
function setPublisher($para)
{
$this->publisher=$para;
}
function getPublisher()
{
echo $this->publisher."<br>";
}
}
$obj=new Novel;
$obj->setTitle("Learn programming C#");
$obj->setPrice(500);
$obj->setPublisher("C# CORNER");
//------------------------------------------------
$obj->getTitle();
$obj->getPublisher();
$obj->getPrice();
?>
</body>
</html>
Subscribe to:
Posts (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...