Sail E0 Webinar

MCQs

Total Questions : 147 | Page 6 of 15 pages
Question 51. Which one of the following is the right way to call a class constant, given that the class is mathFunction?
  1.    echo PI;
  2.    echo mathFunction->PI;
  3.    echo mathFunction::PI;
  4.    echo mathFunction=PI;
 Discuss Question
Answer: Option C. -> echo mathFunction::PI;
Question 52. Which one of the following is the right way to invoke a method?
  1.    $object->methodName();
  2.    object->methodName();
  3.    object::methodName();
  4.    $object::methodName();
 Discuss Question
Answer: Option A. -> $object->methodName();
Question 53. Which of the following is/are the right way to declare a method?
1. function functionName() { function body }
2. scope function functionName() { function body }
3. method methodName() { method body }
4. scope method methodName() { method body }
  1.    Only 2
  2.    Only 4
  3.    1 and 2
  4.    3 and 4
 Discuss Question
Answer: Option C. -> 1 and 2
Question 54. Which of the following method scopes is/are not supported by PHP?
1. private
2. final
3. static
4 abstract
  1.    Only 2
  2.    Only 4
  3.    2 and 4
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned
Question 55. Which method scope prevents a method from being overridden by a subclass?
  1.    Abstract
  2.    Protected
  3.    Final
  4.    Static
 Discuss Question
Answer: Option C. -> Final
Question 56. PHP recognizes constructors by the name_________
  1.    classname()
  2.    _construct()
  3.    function _construct()
  4.    function __construct()
 Discuss Question
Answer: Option D. -> function __construct()
Question 57. Which of the following statements is/are true about Constructors in PHP?
1. PHP 4 introduced class constructors.
2. Constructors can accept parameters.
3. Constructors can call class methods or other functions.
4. Class constructors can call on other constructors.
  1.    2 and 4
  2.    All of the mentioned
  3.    None of the mentioned
  4.    2, 3 and 4
 Discuss Question
Answer: Option B. -> All of the mentioned
Question 58. Which version of PHP introduced the instanceof keyword?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.3
  4.    PHP 6
 Discuss Question
Answer: Option B. -> PHP 5
Question 59. Which one of the following functions is used to determine whether a class exists?
  1.    exist()
  2.    exist_class()
  3.    class_exist()
  4.    __exist()
 Discuss Question
Answer: Option C. -> class_exist()
Question 60. Which one of the following functions is used to determine object type?
  1.    obj_type()
  2.    type()
  3.    is_a()
  4.    is_obj()
 Discuss Question
Answer: Option C. -> is_a()

Latest Videos

Latest Test Papers