PHP OOP Mcqs

Our collections of Multiple choice questions and answers focuses on study of PHP OOP. These questions are chosen from a collection of most authoritative and best reference books on PHP Language. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate PHP OOP Topics comprehensively.

20.
To ask objects about their classes, and ask classes about their parents without searching in code, is example of

Serialization

Inspection

Introspection

Equalization

25.
The practice of separating the user from the true inner workings of an application through well-known interfaces is known as _________

Polymorphism

Inheritance

Encapsulation

Abstraction

27.
The practice of creating objects based on predefined classes is often referred to as..

Class creation

Object creation

Object instantiation

Class instantiation

29.
Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?

$obj = new $foo;

$obj = new foo;

$obj = new foo ();

Obj = new foo ();

30.
Which one of the following is the right way to define a constant?

constant PI = “3.1415”;

const $PI = “3.1415”;

constant PI = ‘3.1415’;

const PI = ‘3.1415’;

31.
Which one of the following is the right way to call a class constant, given that the class is mathFunction?

Echo PI;

Echo mathFunction->PI;

Echo mathFunction::PI;

Echo mathFunction=PI;

0Shares
0
Scroll to Top