Skip to main content

Object Oriented Concept — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Object Oriented Concept — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

PHP recognizes constructors by the name_________

Question 2 of 40
★ FPSC ★ PPSC

Which version of PHP introduced the instanceof keyword?

Question 3 of 40
★ FPSC ★ PPSC

Which one of the following functions is used to determine whether a class exists?

Question 4 of 40
★ FPSC ★ PPSC

Which one of the following functions is used to determine object type?

Question 5 of 40
★ FPSC ★ PPSC

In the PHP code given below, what is/are the properties? <?php class Example { public $name; function Sample () { echo "This is an example" ; } } ?>

Question 6 of 40
★ FPSC ★ PPSC

Which of the following advanced OOP features is/are not supported by PHP? 1. Method overloading 2. Multiple Inheritance 3. Namespaces 4. Object Cloning

Question 7 of 40
★ FPSC ★ PPSC

Which one of the following is the right way to clone an object?

Question 8 of 40
★ FPSC ★ PPSC

Which feature allows us to call more than one method or function of the class in single instruction?

Question 9 of 40
★ FPSC ★ PPSC

A package is a set of related _________

Question 10 of 40
★ FPSC ★ PPSC

Till which version of PHP, developers were forced to name their files in a global context?

Question 11 of 40
★ FPSC ★ PPSC

Which of the following can you place inside a namespace? 1. classes 2. functions 3. variables

Question 12 of 40
★ FPSC ★ PPSC

Which one of the following is the correct way of declaring a namespace?

Question 13 of 40
★ FPSC ★ PPSC

Which symbol is used to declare nested namespaces?

Question 14 of 40
★ FPSC ★ PPSC

Which keyword can be used to fix the above error?

Question 15 of 40
★ FPSC ★ PPSC

Which one of the following statements is true for include_once() and require_once()?

Question 16 of 40
★ FPSC ★ PPSC

Which one of the following statements is true for require() and require_once()?

Question 17 of 40
★ FPSC ★ PPSC

Which function was introduced to help automate the inclusion of class files?

Question 18 of 40
★ FPSC ★ PPSC

How many times can you define _______ autoload in a process?

Question 19 of 40
★ FPSC ★ PPSC

Which one of the following functions will you use to check that the class exists before you work with it?

Question 20 of 40
★ FPSC ★ PPSC

Which one of the following will you use to check the class of an object?

Question 21 of 40
★ FPSC ★ PPSC

PHP 4 did not support instanceof. Instead, which function did it provide?

Question 22 of 40
★ FPSC ★ PPSC

You use the get_class_methods() function to return the names of all the methods in the class. Which function will you use to print it on the screen?

Question 23 of 40
★ FPSC ★ PPSC

If you call a method and it doesn’t exist it’ll cause a problem. To check the method which function will you use?

Question 24 of 40
★ FPSC ★ PPSC

What will be the output if a protected method is given as argument to the function method_exist()?

Question 25 of 40
★ FPSC ★ PPSC

Which one of the following function should I use to find the parent class of a class?

Question 26 of 40
★ FPSC ★ PPSC

Which class accepts a class name or an object reference and returns an array of interface name?

Question 27 of 40
★ FPSC ★ PPSC

Object-oriented code tries to minimize dependencies by moving responsibility for handling tasks away from _______ and toward the objects in the system.

Question 28 of 40
★ FPSC ★ PPSC

Placing a static method for generating _______ objects in the ________ class is convenient.

Question 29 of 40
★ FPSC ★ PPSC

The extent to which proximate procedures are related to one another is known as.

Question 30 of 40
★ FPSC ★ PPSC

______ occurs when discrete parts of a system’s code are tightly bound up with one another so that a change in one part necessitates changes in the others.

Question 31 of 40
★ FPSC ★ PPSC

________ code makes change easier because the impact of altering an implementation will be localized to the component being altered.

Question 32 of 40
★ FPSC ★ PPSC

Polymorphism is also known as______

Question 33 of 40
★ FPSC ★ PPSC

Which one of the following is know as the key to object-oriented programming?

Question 34 of 40
★ FPSC ★ PPSC

Which one among the following means tight coupling?

Question 35 of 40
★ FPSC ★ PPSC

UML stands for?

Question 36 of 40
★ FPSC ★ PPSC

In a class diagram the class is divided into three sections, what is displayed in the first section?

Question 37 of 40
★ FPSC ★ PPSC

_________ are used in class diagrams to describe the way in which specific elements should be used.

Question 38 of 40
★ FPSC ★ PPSC

Which one of the following is displayed below the class name in the class diagrams?

Question 39 of 40
★ FPSC ★ PPSC

+ is the visibility code for?

Question 40 of 40
★ FPSC ★ PPSC

Which relationship is illustrated by a line that begins with an unfilled diamond?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →