MCQOPTIONS
Saved Bookmarks
This section includes 81 Mcqs, each offering curated multiple-choice questions to sharpen your Object Oriented System Design knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Which of the following feature of object oriented program is false? |
| A. | data and functions can be added easily |
| B. | data can be hidden from outside world |
| C. | object can communicate with each other |
| D. | the focus is on procedures |
| Answer» E. | |
| 52. |
What happens when delete is used for a NULL pointer? int *ptr = NULL;delete ptr; |
| A. | compile time error |
| B. | run time error |
| C. | no effect |
| Answer» D. | |
| 53. |
A member function can always access the data |
| A. | in the object of which it is a member. |
| B. | in the class of which it is a member. |
| C. | in any object of the class of which it is a member. |
| D. | in the public part of its class. |
| Answer» B. in the class of which it is a member. | |
| 54. |
Which one of the following is not a valid reserved keyword in C++? |
| A. | explicit |
| B. | public |
| C. | implicit |
| D. | private |
| Answer» D. private | |
| 55. |
It’s perfectly all right to use variables of different data types in the same arithmetic expression. |
| A. | true |
| B. | false |
| Answer» B. false | |
| 56. |
A function’s single most important role is to |
| A. | give a name to a block of code. |
| B. | reduce program size. |
| C. | accept arguments and provide a return value. |
| D. | help organize a program into conceptual units. |
| Answer» E. | |
| 57. |
Which feature of C++ contain the concept of super class and subclass? |
| A. | class and object |
| B. | encapsulation |
| C. | abstraction |
| D. | inheritance |
| Answer» E. | |
| 58. |
Objects of the string class |
| A. | are zero-terminated. |
| B. | can be copied with the assignment operator. |
| C. | do not require memory management. |
| D. | both b and c |
| Answer» E. | |
| 59. |
Which of the following approach is adopted in C++? |
| A. | top down |
| B. | bottom up |
| C. | horizontal |
| D. | vertical |
| Answer» C. horizontal | |
| 60. |
The following is the C++ style comment |
| A. | // |
| B. | /*..*/ |
| C. | – |
| D. | none of above |
| Answer» B. /*..*/ | |
| 61. |
Which of the following is true about new when compared with malloc. 1) new is an operator, malloc is a function 2) new calls constructor, malloc doesn't 3) new returns appropriate pointer, malloc returns void * and pointer needs to typecast to appropriate type. |
| A. | 1 and 3 |
| B. | 2 and 3 |
| C. | 1 and 2 |
| D. | all 1,2,3 |
| Answer» D. all 1,2,3 | |
| 62. |
Can destuctors be private in C++? |
| A. | yes |
| B. | no |
| Answer» B. no | |
| 63. |
Variables declared in the body of a particular member function are known as data members and can be used in all member functions of the class. |
| A. | true |
| B. | false |
| Answer» C. | |
| 64. |
A variable of type char can hold the value 301. |
| A. | true |
| B. | false |
| Answer» C. | |
| 65. |
Which of the following feature of procedure oriented program is false? |
| A. | makes use of bottom up approach |
| B. | functions share global data |
| C. | the most fundamental unit of program is function |
| D. | all of these |
| Answer» B. functions share global data | |
| 66. |
Output of following program?#include using namespace std; class Point {Point() { cout |
| A. | compile time error |
| B. | run time error |
| C. | constructor called |
| Answer» B. run time error | |
| 67. |
The compiler will complain if you try to access array element 14 in a 10-element array. |
| A. | true |
| B. | false |
| Answer» C. | |
| 68. |
Predict the output of following C++ program#include using namespace std;class Empty {}; int main(){cout |
| A. | a non zero value |
| B. | 0 |
| C. | compile time error |
| D. | runtime error |
| Answer» B. 0 | |
| 69. |
class Test { int x;};int main(){Test t; cout |
| A. | 0 |
| B. | garbage value |
| C. | compile time error |
| Answer» D. | |
| 70. |
What is the compilation error for thisprogram? |
| A. | each undeclared identifier is reported only once |
| B. | cout and cin not declared in scope |
| C. | invalid conversion from int to float |
| D. | all of the above |
| Answer» C. invalid conversion from int to float | |
| 71. |
Which of the following data type does not return anything? |
| A. | int |
| B. | short |
| C. | long |
| D. | void |
| Answer» E. | |
| 72. |
What will be the values of x, m and n after execution of the following statements? Int x, m, n;m=10; n=15;x= ++m + n++; |
| A. | x=25, m=10, n=15 |
| B. | x=27, m=10, n=15 |
| C. | x=26, m=11, n=16 |
| D. | x=27, m=11, n=16 |
| Answer» D. x=27, m=11, n=16 | |
| 73. |
What will be the output of following program?#include using namespace std;class Test{public:Test() { cout |
| A. | main started |
| B. | main started hello from test() |
| C. | hello from test() main started |
| D. | compiler error: global objects are not allowed |
| Answer» D. compiler error: global objects are not allowed | |
| 74. |
Which of the following statements is correct for a static member function?1. It can access only other static members of its class. It can be called using the class name, instead of objects |
| A. | only 1 is correct |
| B. | only 2 is correct |
| C. | both 1 and 2 are correct |
| D. | both 1 and 2 are incorrect |
| Answer» D. both 1 and 2 are incorrect | |
| 75. |
An abstract class can be instantiated. |
| A. | true |
| B. | false |
| Answer» C. | |
| 76. |
Which of the following is called as ‘Comiplation unit’?# |
| A. | Object file |
| B. | Byte code |
| C. | Source file |
| D. | All of the mentioned |
| Answer» D. All of the mentioned | |
| 77. |
Java Compiler translates the source code into? |
| A. | Machine code |
| B. | Assembly code |
| C. | Byte code |
| D. | JVM code |
| Answer» D. JVM code | |
| 78. |
Which of the following is/are advantage of using object oriented programming? |
| A. | Code Reusability |
| B. | Can create more than one instance of a class without interference |
| C. | Platform independent |
| D. | All of the mentioned |
| Answer» E. | |
| 79. |
Which of the following approach is followed by Object Oriented Language during the execution of a program? |
| A. | Bottom up approach |
| B. | Top down approach |
| C. | Both a and b |
| D. | None of the mentioned |
| Answer» B. Top down approach | |
| 80. |
Which of the following Paradigm is followed by Object Oriented Language Design? |
| A. | Process-Oriented Model |
| B. | Data Controlling access to code. |
| C. | Both a and b |
| D. | None of the mentioned |
| Answer» C. Both a and b | |
| 81. |
Which of the following approach help us understand better about Real time examples, say Vehicle or Employee of an Organisation? |
| A. | Procedural approach |
| B. | Object Oriented approach |
| C. | Both a and b |
| D. | None of the mentioned |
| Answer» C. Both a and b | |