MCQOPTIONS
Saved Bookmarks
This section includes 916 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 551. |
Can typeid() function be used with the object of generic classes? |
| A. | Yes, only if default type is given |
| B. | Yes, always |
| C. | No, generic data can’t be determined |
| D. | No, never possible |
| Answer» C. No, generic data can’t be determined | |
| 552. |
What are the two specializations of I/O template classes in C++? |
| A. | 16-bit character and wide characters |
| B. | 8-bit character and wide characters |
| C. | 32-bit character and locale characters |
| D. | 64-bit characters and locale characters |
| Answer» C. 32-bit character and locale characters | |
| 553. |
A template class defines the form of a class _____________________ it will operate. |
| A. | With full specification of the data on which |
| B. | With full specification of the functions on which |
| C. | Without full specification of the data on which |
| D. | Without full specification of the functions on which |
| Answer» D. Without full specification of the functions on which | |
| 554. |
Which is the most significant feature that arises by using template classes? |
| A. | Code readability |
| B. | Ease in coding |
| C. | Code reusability |
| D. | Modularity in code |
| Answer» D. Modularity in code | |
| 555. |
What is the syntax to use explicit class specialization? |
| A. | template class myClass<>{ } |
| B. | template class myClass{ } |
| C. | template <> class myClass<>{ } |
| D. | template <> class myClass{ } |
| Answer» E. | |
| 556. |
Can default arguments be used with the template class? |
| A. | Yes, in some special cases |
| B. | Yes, always |
| C. | No, it must satisfy some specific conditions first |
| D. | No, it can’t be done |
| Answer» C. No, it must satisfy some specific conditions first | |
| 557. |
Which among the following is the proper syntax for the template class? |
| A. | template ; |
| B. | Template ; |
| C. | template T named(T x, T y){ } |
| D. | Template T1 named(T1 x, T2 y){ } |
| Answer» D. Template T1 named(T1 x, T2 y){ } | |
| 558. |
A template class can have _____________ |
| A. | More than one generic data type |
| B. | Only one generic data type |
| C. | At most two data types |
| D. | Only generic type of integers and not characters |
| Answer» B. Only one generic data type | |
| 559. |
Is it necessary that all the abstract methods must be defined from an abstract class? |
| A. | Yes, depending on code |
| B. | Yes, always |
| C. | No, never |
| D. | No, if function is not used, no definition is required |
| Answer» C. No, never | |
| 560. |
How many abstract classes can a single program contain? |
| A. | At most 1 |
| B. | At least 1 |
| C. | At most 127 |
| D. | As many as required |
| Answer» E. | |
| 561. |
It is _________________________ to have an abstract method. |
| A. | Not mandatory for an static class |
| B. | Not mandatory for a derived class |
| C. | Not mandatory for an abstract class |
| D. | Not mandatory for parent class |
| Answer» D. Not mandatory for parent class | |
| 562. |
Can abstract classes have static methods (Java)? |
| A. | Yes, always |
| B. | Yes, but depends on code |
| C. | No, never |
| D. | No, static members can’t have different values |
| Answer» B. Yes, but depends on code | |
| 563. |
Abstract class can’t be final in java. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 564. |
The abstract classes in java can _________________ |
| A. | Implement constructors |
| B. | Can’t implement constructor |
| C. | Can implement only unimplemented methods |
| D. | Can’t implement any type of constructor |
| Answer» B. Can’t implement constructor | |
| 565. |
Use of pointers or reference to an abstract class gives rise to which among the following feature? |
| A. | Static Polymorphism |
| B. | Runtime polymorphism |
| C. | Compile time Polymorphism |
| D. | Polymorphism within methods |
| Answer» C. Compile time Polymorphism | |
| 566. |
Which among the following is an important use of abstract classes? |
| A. | Header files |
| B. | Class Libraries |
| C. | Class Libraries |
| D. | Class inheritance |
| Answer» C. Class Libraries | |
| 567. |
We ___________________ to an abstract class. |
| A. | Can create pointers |
| B. | Can create references |
| C. | Can create pointers or references |
| D. | Can’t create any reference, pointer or instance |
| Answer» D. Can’t create any reference, pointer or instance | |
| 568. |
Abstract classes can ____________________ instances. |
| A. | Never have |
| B. | Always have |
| C. | Have array of |
| D. | Have pointer of |
| Answer» B. Always have | |
| 569. |
Abstract class A has 4 virtual functions. Abstract class B defines only 2 of those member functions as it extends class A. Class C extends class B and implements the other two member functions of class A. Choose the correct option below. |
| A. | Program won’t run as all the methods are not defined by B |
| B. | Program won’t run as C is not inheriting A directly |
| C. | Program won’t run as multiple inheritance is used |
| D. | Program runs correctly |
| Answer» E. | |
| 570. |
If a class is extending/inheriting another abstract class having abstract method, then _______________________ |
| A. | Either implementation of method or making class abstract is mandatory |
| B. | Implementation of the method in derived class is mandatory |
| C. | Making the derived class also abstract is mandatory |
| D. | It’s not mandatory to implement the abstract method of parent class |
| Answer» B. Implementation of the method in derived class is mandatory | |
| 571. |
If there is an abstract method in a class then, ________________ |
| A. | Class must be abstract class |
| B. | Class may or may not be abstract class |
| C. | Class is generic |
| D. | Class must be public |
| Answer» B. Class may or may not be abstract class | |
| 572. |
Can abstract class have main() function defined inside it? |
| A. | Yes, depending on return type of main() |
| B. | Yes, always |
| C. | No, main must not be defined inside abstract class |
| D. | No, because main() is not abstract function |
| Answer» C. No, main must not be defined inside abstract class | |
| 573. |
Which among the following best describes abstract classes? |
| A. | If a class has more than one virtual function, it’s abstract class |
| B. | If a class have only one pure virtual function, it’s abstract class |
| C. | If a class has at least one pure virtual function, it’s abstract class |
| D. | If a class has all the pure virtual functions only, then it’s abstract class |
| Answer» D. If a class has all the pure virtual functions only, then it’s abstract class | |
| 574. |
If same object name is given to different objects of different class then _____________ |
| A. | Its compile time error |
| B. | Its runtime error |
| C. | It’s not an error |
| D. | Program suns smooth |
| Answer» B. Its runtime error | |
| 575. |
A single object can be used __________________ |
| A. | As only two class types at a time |
| B. | As only three class types at a time |
| C. | As only one class type at a time |
| D. | As of as many class types as required |
| Answer» D. As of as many class types as required | |
| 576. |
Which object can be used to access the standard input? |
| A. | System.inner |
| B. | cin |
| C. | System.stdin |
| D. | console.input |
| Answer» C. System.stdin | |
| 577. |
Which among the following is not a use of object? |
| A. | Defining a member function |
| B. | Accessing data members |
| C. | Creating instance of a class |
| D. | Using class members |
| Answer» B. Accessing data members | |
| 578. |
Objects can be used _____________________ |
| A. | To access any member of a class |
| B. | To access only public members of a class |
| C. | To access only protected members of a class |
| D. | To access only private members of a class |
| Answer» C. To access only protected members of a class | |
| 579. |
An object can be used to represent _______________ |
| A. | A real world entity |
| B. | A real function |
| C. | Some real data only |
| D. | Some function only |
| Answer» B. A real function | |
| 580. |
Objects type ____________________ |
| A. | Can be changed in runtime |
| B. | Can’t be changed in runtime |
| C. | Can be changed in compile time |
| D. | May or may not get changed |
| Answer» C. Can be changed in compile time | |
| 581. |
Object cout and cin _________________ |
| A. | Can be used directly with << and >> symbols respectively |
| B. | Can be used directly with >> and << symbols respectively |
| C. | Must be used as a function which accepts 2 arguments |
| D. | Must be used as a function which accepts 3 arguments |
| Answer» B. Can be used directly with >> and << symbols respectively | |
| 582. |
What are singleton objects? |
| A. | The only two objects of a class throughout the program |
| B. | The only object of a class throughout the program |
| C. | The only object of a class throughout the program |
| D. | The objects that are created and then deleted without use |
| Answer» C. The only object of a class throughout the program | |
| 583. |
A factory object is used ______________________ |
| A. | To create new classes |
| B. | To create new function |
| C. | To create new data members |
| D. | To create new objects |
| Answer» E. | |
| 584. |
Which object can be used to contain other objects? |
| A. | First class object |
| B. | Derived class object |
| C. | Container object |
| D. | Enclosure object |
| Answer» D. Enclosure object | |
| 585. |
Immutable object are used ______________________ |
| A. | To set up as a fixed state |
| B. | To set up variable object |
| C. | To set up an object of abstract class |
| D. | To set up an object of derived class |
| Answer» B. To set up variable object | |
| 586. |
What is function object? |
| A. | An object with a single function |
| B. | An object with only functions |
| C. | An object with more than one function |
| D. | An object with no functions |
| Answer» B. An object with only functions | |
| 587. |
Which among the following is not a property of an object? |
| A. | Identity |
| B. | Properties |
| C. | Attributes |
| D. | Names |
| Answer» E. | |
| 588. |
Which among the following is main use of object? |
| A. | To create instance of a function |
| B. | To create instance of a program |
| C. | To create instance of class |
| D. | To create instance of structures |
| Answer» D. To create instance of structures | |
| 589. |
Is an array of characters always a string? |
| A. | Yes, always |
| B. | Yes, if each character is terminated by null |
| C. | No, since each character is terminated by null |
| D. | No, never |
| Answer» E. | |
| 590. |
Two dimensional array can’t be initialized with the declaration. |
| A. | True |
| B. | False |
| Answer» C. | |
| 591. |
From which index does the array of objects start? |
| A. | 0 |
| B. | 1 |
| C. | 2 |
| D. | 3 |
| Answer» B. 1 | |
| 592. |
Can we have two dimensional object array? |
| A. | Yes, always |
| B. | Yes, only if primitive type array |
| C. | No, since two indices are impossible |
| D. | No, never |
| Answer» B. Yes, only if primitive type array | |
| 593. |
If an array of objects is of size 10 and a data value have to be retrieved from 5th object then ________________ syntax should be used. |
| A. | Array_Name[4].data_variable_name; |
| B. | Data_Type Array_Name[4].data_variable_name; |
| C. | Array_Name[4].data_variable_name.value; |
| D. | Array_Name[4].data_variable_name(value); |
| Answer» B. Data_Type Array_Name[4].data_variable_name; | |
| 594. |
The Object array is created in _____________________ |
| A. | Heap memory |
| B. | Stack memory |
| C. | HDD |
| D. | ROM |
| Answer» B. Stack memory | |
| 595. |
The objects in an object array _______________________ |
| A. | Can be created without use of constructor |
| B. | Can be created without calling default constructor |
| C. | Can’t be created with use of constructor |
| D. | Can’t be created without calling default constructor |
| Answer» C. Can’t be created with use of constructor | |
| 596. |
How the objects of array can be denoted? |
| A. | Indices |
| B. | Name |
| C. | Random numbers |
| D. | Alphabets |
| Answer» B. Name | |
| 597. |
If constructor arguments are passed to objects of array then ____________ if the constructors are overloaded. |
| A. | It is mandatory to pass same number of arguments to all the objects |
| B. | It is mandatory to pass same type of arguments to all the objects |
| C. | It is not mandatory to call same constructor for all the objects |
| D. | It is mandatory to call same constructor for all the constructors |
| Answer» D. It is mandatory to call same constructor for all the constructors | |
| 598. |
When are the array of objects without any initialization useful? |
| A. | When object data is not required just after the declaration |
| B. | When initialization of object data is to be made by the compiler |
| C. | When object data doesn’t matter in the program |
| D. | When the object should contain garbage data |
| Answer» B. When initialization of object data is to be made by the compiler | |
| 599. |
Which is the condition that must be followed if the array of objects is declared without initialization, only with size of array? |
| A. | The class should have separate constructor for each object |
| B. | The class must have no constructors |
| C. | The class should not have any member function |
| D. | The class must have a default or zero argument constructor |
| Answer» E. | |
| 600. |
If array of objects is declared as given below, which is the limitation on objects? Class_name arrayName[size]; |
| A. | The objects will have same values |
| B. | The objects will not be initialized individually |
| C. | The objects can never be initialized |
| D. | The objects will have same data |
| Answer» C. The objects can never be initialized | |