menu

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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: 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

Discuss Work Space

Answer: option c

Explanation:

The "self" keyword is used to refer to the current class in PHP.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now