menu

PHP OOPs Concepts


1. Which OOPs concept is used to define a blueprint for a class?

Abstraction

Inheritance

Encapsulation

Polymorphism


2. Which keyword is used to declare a class in PHP?

object

new

class

this


3. Which keyword is used to create a new instance of a class in PHP?

this

class

object

new


4. Which keyword is used to declare a method as static in PHP?

static

function

self

$this


5. Which OOPs concept allows objects of different classes to be treated as if they were objects of the same class?

Polymorphism

Inheritance

Encapsulation

Abstraction


6. Which of the following is not a core OOPs concept in PHP?

Inheritance

Encapsulation

Polymorphism

Linear programming


7. Which OOPs concept is used to create objects from abstract classes and interfaces?

Abstraction

Encapsulation

Polymorphism

Inheritance


8. Which keyword is used to prevent a class from being inherited by other classes in PHP?

$final

final

abstract

private


9. Which OOPs concept allows multiple classes to implement the same method in different ways?

Polymorphism

Inheritance

Encapsulation

Abstraction


10. Which OOPs concept is used to define a class in terms of other classes?

Inheritance

Abstraction

Encapsulation

None of the above