PHP OOPs Concepts
PHP OOPs Concepts - Important Points
11. | Which keyword is used to refer to the parent class of a class in PHP? |
---|
A. this
B. self
C. static
D. parent
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The "parent" keyword is used to refer to the parent class of a class in PHP.
12. | Which OOPs concept is used to define a class in terms of other classes? |
---|
A. Inheritance
B. Abstraction
C. Encapsulation
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
Inheritance is the OOPs concept that is used to define a class in terms of other classes.
13. | Which keyword is used to declare a method as static in PHP? |
---|
A. static
B. function
C. self
D. $this
View Answer Discuss Work SpaceAnswer: option a
Explanation:
The "static" keyword is used to declare a method as static in PHP.
14. | Which OOPs concept is used to hide the implementation details of a class? |
---|
A. Encapsulation
B. Inheritance
C. Polymorphism
D. Abstraction
View Answer Discuss Work SpaceAnswer: option a
Explanation:
Encapsulation is the OOPs concept that is used to hide the implementation details of a class.
15. | Which keyword is used to refer to the current class in PHP? |
---|
A. $self
B. $this
C. self
D. parent
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The "self" keyword is used to refer to the current class in PHP.