41.
Which one of the following statements is true ?
class CopyMe {}
$first = new CopyMe();
$second = $first;

42.
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?

43.
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;

44.
______clone() is run on the _______ object.

46.
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
    }
}

48.
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?

50.
Which one of the following property scopes is not supported by PHP?

Read More Section(Object Oriented Concept)

Each Section contains maximum 100 MCQs question on Object Oriented Concept. To get more questions visit other sections.