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 5.3
  2.    PHP 4
  3.    PHP 6
  4.    PHP 5
 Discuss Question
Answer: Option D. -> PHP 5
Question 12. 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 13. Which one of the following is the right description for the method getMessage() ?
  1.    Returns the message if it is passed to the class
  2.    Returns the message if it is passed to the object
  3.    Returns the message if it is passed to the file
  4.    Returns the message if it is passed to the constructor
 Discuss Question
Answer: Option D. -> Returns the message if it is passed to the constructor
Question 14. Which version added the method getPrevious()?
  1.    PHP 5
  2.    PHP 5.3
  3.    PHP 5.1
  4.    PHP 4
 Discuss Question
Answer: Option B. -> PHP 5.3
Question 15. How many methods are available for the exception class?
  1.    5
  2.    6
  3.    7
  4.    8
 Discuss Question
Answer: Option C. -> 7
Question 16. You can extend the exception base class, but you cannot override any of the preceding methods because the are declared as__________
  1.    final
  2.    private
  3.    protected
  4.    static
 Discuss Question
Answer: Option A. -> final
Question 17. Which of the following is/are an exception?1. OutOfBoundException2. OutOfRangeException3. OverflowException4. UnderflowException
  1.    1 and 2
  2.    1 and 3
  3.    None of the mentioned
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned
Question 18. What does SPL stand for?
  1.    Source PHP Library
  2.    Standard PHP Library
  3.    Standard PHP List
  4.    Source PHP List
 Discuss Question
Answer: Option B. -> Standard PHP Library
Question 19. How many predefined exceptions does SPL provide access to?
  1.    14
  2.    16
  3.    15
  4.    13
 Discuss Question
Answer: Option D. -> 13
Question 20. Which of the following is/are not an exception?1. BadFunctionCallException2. BadMethodCallException3. LogicException4. DomainException
  1.    None of the mentioned
  2.    Only 4
  3.    3 and 4
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> None of the mentioned

Latest Videos

Latest Test Papers