PHP OOPs Concepts
PHP OOPs Concepts - Important Points
1. | What is the full form of OOP in PHP? |
---|
A. Object Oriented Programming
B. Online Order Processing
C. Operating Oriented Programming
D. Object Oriented Python
View Answer Discuss Work SpaceAnswer: option a
Explanation:
OOP stands for Object Oriented Programming, which is a programming paradigm that uses objects to represent data and methods that operate on that data.
2. | Which of the following is not a core OOPs concept in PHP? |
---|
A. Inheritance
B. Encapsulation
C. Polymorphism
D. Linear programming
View Answer Discuss Work SpaceAnswer: option d
Explanation:
Linear programming is not a core OOPs concept in PHP. Inheritance, Encapsulation, and Polymorphism are the three main pillars of OOPs in PHP.
3. | Which keyword is used to declare a class in PHP? |
---|
A. object
B. new
C. class
D. this
View Answer Discuss Work SpaceAnswer: option c
Explanation:
The "class" keyword is used to declare a class in PHP.
4. | Which OOPs concept allows one class to inherit properties and methods from another class? |
---|
A. Inheritance
B. Encapsulation
C. Polymorphism
D. Abstraction
View Answer Discuss Work SpaceAnswer: option a
Explanation:
Inheritance is the OOPs concept that allows one class to inherit properties and methods from another class.
5. | Which keyword is used to create a new instance of a class in PHP? |
---|
A. this
B. class
C. object
D. new
View Answer Discuss Work SpaceAnswer: option d
Explanation:
The "new" keyword is used to create a new instance of a class in PHP.