Hello Friends ..
Today is Thursday, and as you know every Thursday we have weekly test for PHP developers.... conducted by M2 Software Solutions
Que. 1. Which of the following is/are true for an abstract class?
i) A class is declared abstract by prefacing the definition with the word abstract.
ii) A class is declare abstract by using the keyword implements.iii) It is a class that really isn’t supposed to ever be instantiated but instead serves as a base class.
iv) Attempting to instantiate an abstract class results in an error.
a) Only ii)
b) All of the mentioned
c) ii) and iv)
d) ii), iii) and iv)
Que. 2. If one intends to create a model that will be assumed by a number of closely related objects, which class must be used?
a) Normal class
b) Static class
c) Abstract class
d) Interface
Que. 3. If your object must inherit behavior from a number of sources you must use a/an
a) Interface
b) Object
c) abstract class
d) static class
Que. 4. Which method is used to tweak an object’s cloning behavior?
a) clone()
b) __clone()
c) _clone
d) object_clone()
Que. 5. Which feature allows us to call more than one method or function of the class in single instruction?
a) Typecasting
b) Method Including
c) Method adding
d) Method chaining
Que. 6. Which magic method is used to implement overloading in PHP?
a) __call
b) __invoke
c) __wakeup
d) __unset
Que. 7. Which one of the following statements is true ?
class CopyMe {}
$first = new CopyMe();
$second = $first;
b) In PHP 5: $second and $first are 2 distinct objects
c) In PHP 4: $second and $first refer to one object
d) None of the above
Que. 8. 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
}
}
b) Value of the bill calculated
c) PHP Fatal error: Cannot find object
d) PHP Fatal error: Cannot override final method
Que. 9. __clone() is run on the ___ object.
a) original
b) pseudo
c) external
d) copied
Que. 10. Which keyword is used to put a stop on inheritance?
a) stop
b) end
c) break
d) final
Answer-sheet of this test will be available tomorrow...
0 comments:
Post a Comment