41. Which keyword must be added before $first variable on the third line of the above question to make $second and $first as distinct objects in PHP 5?
42. What will be the output of the following PHP code
class Person
{
function getName() { return "Bob"; }
function getAge() { return 44; }
function __toString() {
$desc = $this->getName();
$desc .= " (age ".$this->getAge().")";
return $desc;
}
}
$person = new Person();
print $person;
class Person
{
function getName() { return "Bob"; }
function getAge() { return 44; }
function __toString() {
$desc = $this->getName();
$desc .= " (age ".$this->getAge().")";
return $desc;
}
}
$person = new Person();
print $person;
43. ______clone() is run on the _______ object.
44. Which method is invoked when an undefined property is accessed ?
45. What will be the output of the following PHP code?
class Checkout
{
final function totalize()
{
// calculate bill
}
}
class IllegalCheckout extends Checkout
{
final function totalize()
{
// change bill calculation
}
}
class Checkout
{
final function totalize()
{
// calculate bill
}
}
class IllegalCheckout extends Checkout
{
final function totalize()
{
// change bill calculation
}
}
46. The practice of separating the user from the true inner workings of an application through well-known interfaces is known as _________
47. Which of the following term originates from the Greek language that means “having multiple forms,” defines OOP’s ability to redefine, a class’s characteristics?
48. The practice of creating objects based on predefined classes is often referred to as.
49. Which one of the following property scopes is not supported by PHP?
50. Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?
Read More Section(Object Oriented Concept)
Each Section contains maximum 100 MCQs question on Object Oriented Concept. To get more questions visit other sections.