Sail E0 Webinar

MCQs

Total Questions : 20 | Page 2 of 2 pages
Question 11. Which version of PHP was added with Exception handling?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.3
  4.    PHP 6
 Discuss Question
Answer: Option B. -> PHP 5
Question 12. How many methods are available for the exception class?
  1.    5
  2.    6
  3.    7
  4.    8
 Discuss Question
Answer: Option C. -> 7
Question 13. Which of the following statements invoke the exception class?
  1.    throws new Exception();
  2.    throw new Exception();
  3.    new Exception();
  4.    new throws Exception();
 Discuss Question
Answer: Option B. -> throw new Exception();
Question 14. Which version added the method getPrevious()?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.1
  4.    PHP 5.3
 Discuss Question
Answer: Option D. -> PHP 5.3
Question 15. Which one of the following is the right description for the method getMessage() ?
  1.    Returns the message if it is passed to the constructor
  2.    Returns the message if it is passed to the class
  3.    Returns the message if it is passed to the file
  4.    Returns the message if it is passed to the object
 Discuss Question
Answer: Option A. -> Returns the message if it is passed to the constructor
Question 16. You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as__________
  1.    protected
  2.    final
  3.    static
  4.    private
 Discuss Question
Answer: Option B. -> final
Question 17. How many predefined exceptions does SPL provide access to?
  1.    13
  2.    14
  3.    15
  4.    16
 Discuss Question
Answer: Option A. -> 13
Question 18. What does SPL stand for?
  1.    Standard PHP Library
  2.    Source PHP Library
  3.    Standard PHP List
  4.    Source PHP List
 Discuss Question
Answer: Option A. -> Standard PHP Library
Question 19. Which of the following is/are not an exception?
1. BadFunctionCallException
2. BadMethodCallException
3. LogicException
4. DomainException
  1.    All of the mentioned
  2.    Only 4
  3.    3 and 4
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned
Question 20. Which of the following is/are an exception?
1. OutOfBoundException
2. OutOfRangeException
3. OverflowException
4. UnderflowException
  1.    All of the mentioned
  2.    1 and 3
  3.    1 and 2
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> All of the mentioned

Latest Videos

Latest Test Papers