Object Oriented Concept(Php ) Questions and Answers
Question 3. 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. 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.
Explanation:-
Answer: Option A. -> Only 2Explanation:-
Answer: Option B. -> PHP 5The new unified constructors use the name __construct(). Using the old syntax, a call to a parent constructor would tie you to that particular class: parent::ShopProduct();
Explanation:-
Answer: Option A. -> baseA class that inherits from another is said to be a subclass of it. This relationship is often described in terms of parents and children. A child class is derived from and inherits characteristics from the parent.