Answer Posted / lakshmanan
Using extends keyword you can extend Superclass.
Lets go for an example,
Class Pay{
var $Amt=10;
var $M="";
Function CheckAmt($Amt){
$this->Amt=$Amt;
}
}
Class Salary extends Pay{
Function CheckAmt($Amt){
$this->Amt=$Amt;
If ($this->Amt > 1000){
echo "Good Salary";
} else {
echo "Okay Salary";
}
}
}
$CheckP = new Pay;
echo $CheckP->Amt;
echo "<br>";
$CheckP->CheckAmt(1000);
echo $CheckP->Amt;
echo "<br>";
$CheckS = new Salary;
echo $CheckS->CheckAmt(100000);
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
why we calld java object orinted programming language??
Iam getting xml when we click on one button.Iam placing that
xml in dom.Im getting that xml data in one xsl.In that xsl
I want to increase the variable value which is declared in
xsl.
Ex:
How can we establish connection with java and sql server?
What is meant by object oriented programming?
What is arguments object in JavaScript?
What is npm repository?
Explain the process of document loading.
What does the following statement declares?
Why jquery is used instead of javascript?
How can we detect os of the client machine using javascript?
What is the difference between an array and an object?
What is string in javascript?
How you can modify XAML content from JavaScript in Silverlight?
Is a function an object?
How to access the value of a textbox using javascript?