Explore topic-wise MCQs in Technical Programming.

This section includes 411 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

1.

Inheritance in class diagrams is depicted by________

A. single-headed empty arrow
B. single-headed filled arrow
C. double-headed empty arrow
D. double-headed filled arrow
Answer» B. single-headed filled arrow
2.

Which one of the following is displayed in the third section of the class diagram?

A. Operations
B. Inheritance
C. Abstraction
D. Coupling
Answer» B. Inheritance
3.

is the visibility code for?

A. Private
B. Friendly
C. Friendly
D. Static
Answer» D. Static
4.

A bidirectional relationship in class diagrams is described by________

A. double-headed arrow
B. visibility symbols
C. single-headed arrow
D. double diamond
Answer» B. visibility symbols
5.

Which one of the following statements is true about sequence diagrams?

A. A sequence diagram is class based
B. A sequence diagram presents the participants of a system from right to left
C. The vertical broken lines represent the lifetime of the class in the system
D. A sequence diagram is object based
Answer» E.
6.

If the diamond is filled it depicts which relationship?

A. Strong Aggregation
B. Composition
C. Abstraction
D. Inheritance
Answer» C. Abstraction
7.

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

A. Composition
B. Abstraction
C. Aggregation
D. Inheritance
Answer» D. Inheritance
8.

+ is the visibility code for?

A. Public
B. Private
C. Protected
D. Friendly
Answer» B. Private
9.

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

A. Functions
B. Methods
C. Attributes
D. Constraints
Answer» D. Constraints
10.

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

A. Attributes
B. Constraints
C. Constants
D. Class Names
Answer» C. Constants
11.

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

A. Class Attributes
B. Class Declaration
C. Class Name
D. Class Functions
Answer» D. Class Functions
12.

UML stands for?

A. unified mailing language
B. unified modeling logo
C. undefined modeling language
D. unified modeling language
Answer» E.
13.

Which one among the following means tight coupling ?

A. Code Duplication
B. Inheritance
C. Encapsulation
D. Polymorphism
Answer» B. Inheritance
14.

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

A. Polymorphism
B. Encapsulation
C. Data Abstraction
D. Orthogonality
Answer» C. Data Abstraction
15.

Polymorphism is also known as______

A. switch
B. overact
C. encapsulation
D. class switching
Answer» E.
16.

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

A. Orthogonal
B. Cohesion
C. Coupling
D. Balancing
Answer» B. Cohesion
17.

______ 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.

A. Loose Coupling
B. Tight Coupling
C. Co-relation
D. Balancing
Answer» C. Co-relation
18.

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

A. Coupling
B. Balancing
C. Cohesion
D. Co-relation
Answer» D. Co-relation
19.

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

A. child parent
B. parent child
C. final static
D. static final
Answer» B. parent child
20.

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

A. server code
B. client code
C. machine code
D. procedural code
Answer» C. machine code
21.

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

A. class_implements()
B. is_subclass()
C. is_subclass_of()
D. class_interface()
Answer» B. is_subclass()
22.

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

A. get_parent_class()
B. parent_class()
C. class_parent()
D. get_class_parent()
Answer» B. parent_class()
23.

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

A. Method does not exist
B. False
C. Error
D. True
Answer» E.
24.

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

A. _method()
B. methodexists()
C. is_callable()
D. is_method()
Answer» D. is_method()
25.

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?

A. printf()
B. print_ar
C. print_r
D. echo
Answer» D. echo
26.

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

A. is()
B. get_class()
C. is_a()
D. is_the()
Answer» D. is_the()
27.

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

A. class()
B. _class()
C. get_class()
D. class_check()
Answer» D. class_check()
28.

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

A. class_exist()
B. class_exists()
C. exist()
D. exists_class()
Answer» C. exist()
29.

How many times can you define __autoload in a process?

A. once
B. twice
C. thrice
D. as many times as needed
Answer» B. twice
30.

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

A. __load()
B. __preload()
C. __autoload()
D. __inload()
Answer» D. __inload()
31.

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

A. They are functions
B. They are statements
C. They’ll not work if the () is not present
D. They can not be used to require files
Answer» C. They’ll not work if the () is not present
32.

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

A. Both are exactly the same
B. include_once is used for files where as require_once() is not
C. Both Handle the errors in the same way
D. Both do not handle the errors in the same way
Answer» E.
33.

Which keyword can be used to fix the above error?

A. flx
B. join
C. use
D. namespace
Answer» D. namespace
34.

Output of namespace main; com\getinstance\util\Debug::helloWorld() is PHP Fatal error: Class ‘main\com\getinstance\util\Debug’ not found in … Using which one of the following lines will the error be removed?

A. omgetinstanceutilDebug::helloWorld();
B. getinstanceutilDebug::helloWorld();
C. main.comgetinstanceutilDebug::helloWorld();
D. omgetinstanceutilDebug::helloWorld();
Answer» E.
35.

Which symbol is used to declare nested namespaces?

A. /
B.
C. .
D. |
Answer» C. .
36.

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

A. namespace my;
B. namespace my();
C. my namespace;
D. namespace(my);
Answer» B. namespace my();
37.

Which of the following can you place inside a namespace? i) classes ii) functions iii) variables

A. i)
B. ii)
C. III)
D. All of the mentioned
Answer» E.
38.

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

A. PHP 4
B. PHP 5
C. PHP 5.2
D. PHP 5.3
Answer» E.
39.

A package is a set of related _________

A. Objects
B. Classes
C. Programs
D. Functions
Answer» C. Programs
40.

Which method is invoked when an undefined property is accessed ?

A. __get()
B. __isset()
C. __unset()
D. __undefined()
Answer» B. __isset()
41.

__clone() is run on the ___ object.

A. original
B. pseudo
C. pseudo
D. copied
Answer» E.
42.

Which keyword must be added before $first variable on the third line of the above question to make $second and $first as distinct objects in PHP 5?

A. copy
B. clone
C. cut
D. Can’t add any word to make them distinct
Answer» C. cut
43.

Which method introduced in PHP 5, is invoked just before an object is garbage collected?

A. __collect()
B. __garbage()
C. __destruct()
D. __destructor()
Answer» D. __destructor()
44.

Which one of the following method is invoked when an undefined method is called by client code?

A. __get()
B. __isset()
C. __unset()
D. __call()
Answer» E.
45.

Which one of the following method is invoked when a value is assigned to an undefined property?

A. __get()
B. __set()
C. __isset()
D. __call()
Answer» C. __isset()
46.

PHP provides built-in interceptor methods, which can intercept messages sent to undefined methods and properties. This is also known as _________

A. overloading
B. overriding
C. overbending
D. overbinding
Answer» B. overriding
47.

Which keyword is used to put a stop on inheritance?

A. STOP
B. end
C. break
D. Final
Answer» E.
48.

Which one of the following keyword is used in conjunction with an Exception object?

A. throws
B. exception
C. throw
D. final
Answer» D. final
49.

Which one of the following methods in the exception class, is used to get a nested exception object?

A. getPrevious()
B. getCode()
C. getFile()
D. getLine()
Answer» B. getCode()
50.

Which version of PHP introduced the concept called late static binding?

A. PHP 4
B. PHP 5
C. PHP 5.1
D. PHP 5.3
Answer» E.