MCQGeeks
0 : 0 : 1
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
PHP
Object Oriented Concept
Quiz 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Q.1
Which one of the following is displayed below the class name in the class diagrams?
Functions
Methods
Attributes
Constraints
Q.2
+ is the visibility code for?
Public
Private
Protected
Friendly
Q.3
A valid class name starts with a ......., followed by any number of letters, numbers, or underscores.
1. Number
2. Letter
3. Period
4. Underscore
Option 1 and 4
Option 2 and 3
Option 3 and 4
Option 1 and 3
Q.4
Which relationship is illustrated by a line that begins with an unfilled diamond?
Composition
Abstraction
Aggregation
Inheritance
Q.5
If the diamond is filled it depicts which relationship?
Strong Aggregation
Composition
Abstraction
Inheritance
Q.6
Which one of the following statements is true about sequence diagrams?
A sequence diagram is class based
A sequence diagram presents the participants of a system from right to left
The vertical broken lines represent the lifetime of the class in the system
A sequence diagram is object based
Q.7
Which one of the following is know as the key to object-oriented programming?
Polymorphism
Encapsulation
Data Abstraction
Orthogonality
Q.8
Which one among the following means tight coupling?
Code Duplication
Inheritance
Encapsulation
Polymorphism
Q.9
UML stands for?
unified mailing language
unified modeling logo
undefined modeling language
unified modeling language
Q.10
In a class diagram the class is divided into three sections, what is displayed in the first section?
Class Attributes
Class Declaration
Class Name
Class Functions
Q.11
_________ are used in class diagrams to describe the way in which specific elements should be used.
Attributes
Constraints
Constants
Class Names
Q.12
Placing a static method for generating _______ objects in the ________ class is convenient.
child parent
parent child
final static
static final
Q.13
The extent to which proximate procedures are related to one another is known as.
Coupling
Balancing
Cohesion
Co-relation
Q.14
______ 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.
Loose Coupling
Tight Coupling
Co-relation
Balancing
Q.15
________ code makes change easier because the impact of altering an implementation will be localized to the component being altered.
Orthogonal
Cohesion
Coupling
Balancing
Q.16
Polymorphism is also known as______
switch
overact
encapsulation
class switching
Q.17
If you call a method and it doesn’t exist it’ll cause a problem. To check the method which function will you use?
_method()
methodexists()
is_callable()
is_method()
Q.18
What will be the output if a protected method is given as argument to the function method_exist()?
Method does not exist
False
Error
True
Q.19
How many times can you define _______ autoload in a process?
once
twice
thrice
as many times as needed
Q.20
Which one of the following function should I use to find the parent class of a class?
get_parent_class()
parent_class()
class_parent()
get_class_parent()
Q.21
Which class accepts a class name or an object reference and returns an array of interface name?
class_implements()
is_subclass()
is_subclass_of()
class_interface()
Q.22
Which one of the following functions will you use to check that the class exists before you work with it?
class_exist()
class_exists()
exist()
exists_class()
Q.23
Which one of the following will you use to check the class of an object?
class()
_class()
class_check()
get_class()
Q.24
Which symbol is used to declare nested namespaces?
/
\
.
|
Q.25
Which keyword can be used to fix the above error?
fix
join
use
namespace
Q.26
Object-oriented code tries to minimize dependencies by moving responsibility for handling tasks away from _______ and toward the objects in the system.
server code
client code
machine code
procedural code
Q.27
PHP 4 did not support instanceof. Instead, which function did it provide?
is()
get_class()
is_a()
is_the()
Q.28
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?
printf()
print_ar
print_r
echo
Q.29
Which one of the following statements is true for include_once() and require_once()?
Both are exactly the same
include_once is used for files where as require_once() is not
Both Handle the errors in the same way
Both do not handle the errors in the same way
Q.30
Which one of the following statements is true for require() and require_once()?
They are functions
They are statements
They’ll not work if the () is not present
They can not be used to require files
0 h : 0 m : 1 s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqgeeks.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page