My Report

PHP Programming Practice Test 6


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Output:

    namespace main;
    com\getinstance\util\Debug::helloWorld()
PHP Fatal error: Class 'main\com\getinstance\util\Debug' not found in ...

Using which one of the following PHP lines will the error be removed?

2. You use the get_class_methods() function to return the names of all the methods in the class. Which function will you use to print it on the screen?

3. UML stands for?

4. Which one among the following means tight coupling?

5. __clone() is run on the ___ object.

6. Which one of the following keyword is used in conjunction with an Exception object?

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

8. Which one of the following is the correct way of declaring a namespace?

9. ________ are used in class diagrams to describe the way in which specific elements should be used.

10. Which one of the following is known as the key to object-oriented programming?


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.