Sail E0 Webinar

MCQs

Total Questions : 147 | Page 7 of 15 pages
Question 61. Which one of the following keyword is used to inherit our subclass into a superclass?
  1.    extends
  2.    implements
  3.    inherit
  4.    include
 Discuss Question
Answer: Option A. -> extends
Question 62. In the PHP code given below, what is/are the properties?
  1.    echo “This is an example”;
  2.    public $name;
  3.    class Example
  4.    function sample()
 Discuss Question
Answer: Option B. -> public $name;
Question 63. Which keyword is used to refer to properties or methods within the class itself?
  1.    private
  2.    public
  3.    protected
  4.    $this
 Discuss Question
Answer: Option D. -> $this
Question 64. Which keyword allows class members (methods and properties) to be used without needing to instantiate a new instance of the class?
  1.    protected
  2.    final
  3.    static
  4.    private
 Discuss Question
Answer: Option C. -> static
Question 65. Which of the following advanced OOP features is/are not supported by PHP?
1. Method overloading
2. Multiple Inheritance
3. Namespaces
4. Object Cloning
  1.    All of the mentioned
  2.    None of the mentioned
  3.    1 and 2
  4.    3 and 4
 Discuss Question
Answer: Option C. -> 1 and 2
Question 66. Which one of the following is the right way to clone an object?
  1.    _clone(targetObject);
  2.    destinationObject = clone targetObject;
  3.    destinationObject = _clone(targetObject);
  4.    destinationObject = clone(targetObject);
 Discuss Question
Answer: Option B. -> destinationObject = clone targetObject;
Question 67. Which version of PHP introduced the advanced concepts of OOP?
  1.    PHP 4
  2.    PHP 5
  3.    PHP 5.3
  4.    PHP 6
 Discuss Question
Answer: Option B. -> PHP 5
Question 68. The class from which the child class inherits is called.
1. Child class
2. Parent class
3. Super class
4. Base class
  1.    Only 1
  2.    2, 3 and 4
  3.    Only 3
  4.    2 and 4
 Discuss Question
Answer: Option D. -> 2 and 4
Question 69. Which of the following is/are true for an abstract class?
1. A class is declared abstract by prefacing the definition with the word abstract.
2. A class is declare abstract by using the keyword implements.
3. It is a class that really isn’t supposed to ever be instantiated but instead serves as a base class.
4. Attempting to instantiate an abstract class results in an error.
  1.    Only 2
  2.    All of the mentioned
  3.    2 and 4
  4.    2, 3 and 4
 Discuss Question
Answer: Option A. -> Only 2
Question 70. If your object must inherit behavior from a number of sources you must use a/an
  1.    Interface
  2.    Object
  3.    Abstract class
  4.    Static class
 Discuss Question
Answer: Option A. -> Interface

Latest Videos

Latest Test Papers