Olete.in
Articles
Mock Tests
🧪 OOPS MCQ Quiz Hub
OOPS Mcq Question Set 2
Choose a topic to test your knowledge and improve your OOPS skills
1. Which among doesn’t illustrates polymorphism?
Function overloading
Function overriding
Operator overloading
Virtual function
2. Exception handling is a feature of OOP.
True
False
all of the above
None of the mentioned
3. Which among the following, for a pure OOP language, is true?
The language should follow 3 or more features of OOP
The language should follow at least 1 feature of OOP
The language must follow only 3 features of OOP
The language must follow all the rules of OOP
4. Does OOP provide better security than POP?
Always true for any programming language
May not be true with respect to all programming languages
It depends on type of program
It’s vice-versa is true
5. Which of the following approach help us understand better about Real time examples, say Vehicle or Employee of an Organisation?
Procedural approach
Object Oriented approach
Both a and b
none of the mentioned
6. Which of the following Paradigm is followed by Object Oriented Language Design?
Process-Oriented Model
Data Controlling access to code.
Both a and b
None of the mentioned
7. Which of the following approach is followed by Object Oriented Language during the execution of a program?
Bottom up approach
Top down approach
Both a and b
none of the mentioned
8. Which of the following is/are advantage of using object oriented programming?
Code Reusability
Can create more than one instance of a class without interference
Platform independent
All of the Mentioned
9. Java Compiler translates the source code into?
Machine code
Assembly code
Byte code
JVM code
10. What is the output of this program? class PrintTest { public static void main(String args[]) { int num = 10; if (NUM < 100) { System.out.println("The value of num is"+ num); } } }
Compilation error
Run time error
The value of num is 10
None of the mentioned
11. Which of the following is called as ‘Comiplation unit’?
Object file
Byte code
Source file
All of the Mentioned
12. What is the output of this program? class TypeChecking { public static void main(String args[]) { int num = 10.5; System.out.println("Output :The value of num is" +num); } }
Output: The value of num is 10.5
Run-time error
Compilation error
None of the mentioned
13. Which is a named memory location assigned a value by the program?
variable
literal
identifier
None of the mentioned
14. Which among the following is the main use of object?
To create instance of a function
To create instance of a program
To create instance of class
To create instance of structures
15. Which among the following is not a property of an object?
Identity
Properties
Attributes
Names
16. What is function object?
An object with a single function
An object with only functions
An object with more than one function
An object with no functions
17. Immutable object are used _________
To set up as a fixed state
To set up variable object
To set up an object of abstract class
To set up an object of derived class
18. Which object can be used to contain other objects?
First class object
Derived class object
Container object
Enclosure object
19. A factory object is used ______
To create new classes
To create new function
To create new data members
To create new objects
20. What are singleton objects?
The only two objects of a class throughout the program
The only object of a class throughout the program
The objects that are alive throughout the program
The objects that are created and then deleted without use
21. Object cout and cin _______
Can be used directly with &lt;&lt; and &gt;&gt; symbols respectively
Can be used directly with &gt;&gt; and &lt;&lt; symbols respectively
Must be used as a function which accepts 2 arguments
Must be used as a function which accepts 3 arguments
22. Objects type _________
Can be changed in runtime
Can’t be changed in runtime
Can be changed in compile time
May or may not get changed
23. An object can be used to represent _________
A real world entity
A real function
Some real data only
Some function only
24. Objects can be used _______
To access any member of a class
To access only public members of a class
To access only protected members of a class
To access only private members of a class
25. Which among the following is not a use of object?
Defining a member function
Accessing data members
Creating instance of a class
Using class members
26. Which object can be used to access the standard input?
System.inner
cin
System.stdin
console.input
27. A single object can be used ________
As only two class types at a time
As only three class types at a time
As only one class type at a time
As of as many class types as required
28. If same object name is given to different objects of different class then ____
Its compile time error
Its runtime error
It’s not an error
Program suns smooth
29. Passing object to a function _______
Can be done only in one way
Can be done in more than one ways
Is not possible
Is not possible in OOP
30. The object ________
Can be passed by reference
Can be passed by value
Can be passed by reference or value
Can be passed with reference
31. Which symbol should be used to pass the object by reference in C++?
&amp;
@
$
$ or &amp;
32. If object is passed by value _________
Copy constructor is used to copy the values into another object in the function
Copy constructor is used to copy the values into temporary object
Reference to the object is used to access the values of the object
Reference to the object is used to created new object in its place
33. Pass by reference of an object to a function ______
Affects the object in called function only
Affects the object in prototype only
Affects the object in caller function
Affects the object only if mentioned with &amp; symbol with every call
34. Copy constructor definition requires ________
Object to be passed by value
Object not to be passed to it
Object to be passed by reference
Object to be passed with each data member value
35. What is the type of object that should be specified in the argument list?
Function name
Object name itself
Caller function name
Class name of object
36. If an object is passed by value, __________
Temporary object is used in the function
Local object in the function is used
Only the data member values are used
The values are accessible from the original object
37. Can data members be passed to a function using the object?
Yes, it can be passed only inside class functions
Yes, only if the data members are public and are being passed to a function outside the class
No, can’t be passed outside the class
No, can’t be done
38. What exactly is passed when an object is passed by reference?
The original object name
The original object class name
The exact address of the object in memory
The exact address of data members
39. If the object is not to be passed to any function but the values of the object have to be used then?
The data members should be passed separately
The data members and member functions have to be passed separately
The values should be present in other variables
The object must be passed
40. Which among the following is true?
More than one object can’t be passed to a function
Any number of objects can be passed to a function
Objects can’t be passed, only data member values can be passed
Objects should be passed only if those are public in class
41. In which type is new memory location will be allocated?
Only in pass by reference
Only in pass by value
Both in pass by reference and value
Depends on the code
42. Pass by reference and pass by value can’t be done simultaneously in a single function argument list.
True
False
all of the above
None of the mentioned
43. What are the constant member functions?
Functions which doesn’t change value of calling object
Functions which doesn’t change value of any object inside definition
Functions which doesn’t allow modification of any object of class
Functions which doesn’t allow modification of argument objects
44. Which keyword must be used to declare a member function as a constant member function?
Constant
Const
FunctionConst
Unchanged
45. Which objects can call the const functions?
Only const objects
Only non-const objects
Both const and non-const objects
Neither const not non-const objects
46. Non-const functions ___________
Can be called only from non-const object
Can be called only from const object
Can be called both by const and non-const object
Can’t be called with object
47. Which is the correct condition on const member functions?
Const member functions can’t call non-const member functions
Const member functions can’t call any other function
Const member functions can call only the functions which are neither const nor non-const
Const member functions can call only data members of call not member functions
48. If a const object calls a non-const member function then _________
Run time error may get produced
Compile time error may get produced
Either compile time or run time error is produced
The program can’t be compiled
49. Can a constructor function be constant?
Yes, always
Yes, only if permissions are given
No, because objects are not involved
No, never
50. A function can have both the const and non-const version in the same program.
True
False
all of the above
None of the mentioned
Submit