MCQs
Total Questions : 30
| Page 2 of 3 pages
Answer: Option D. -> const PI = '3.1415';
Class constants are created like: const NAME = 'VALUE';
Answer: Option C. -> (ii) and (iv)
PHP supports six method scopes: public, private, final, static, protected and abstract.
Answer: Option A. -> $object->methodName();
$object->methodName();
Answer: Option C. -> (i) and (ii)
In case of public methods, you can forgo explicitly declaring the scope and just declare the method like you would a function.
Answer: Option C. -> echo mathFunction::PI;
echo mathFunction::PI;
Answer: Option C. -> Encapsulation
Encapsulation
Answer: Option D. -> class instantiation
class instantiation
Answer: Option B. -> Polymorphism
Polymorphism
Answer: Option C. -> $obj = new foo ();
$obj = new foo ();
Answer: Option A. -> friendly
PHP supports five class property scopes: public, private, protected, final and static.