

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.
501. |
Which among the following is the most abstract form of class? |
A. | Cars |
B. | BMW Cars |
C. | Big cars |
D. | Small cars |
Answer» B. BMW Cars | |
502. |
Why do classes use mutator methods? |
A. | Allows client to modify the program |
B. | Allows client to modify/write the private members |
C. | Allows servers to access all the private data |
D. | Allows servers to access only protected members |
Answer» C. Allows servers to access all the private data | |
503. |
Why do classes use accessor methods? |
A. | To make public data accessible to client |
B. | To make public data private to client |
C. | To make private data public for whole program |
D. | To make private data accessible to the client |
Answer» E. | |
504. |
Why do we use user defined classes? |
A. | To design a user intended code |
B. | To model real world objects |
C. | To design the interfaces |
D. | To model the functions |
Answer» C. To design the interfaces | |
505. |
Which feature is exhibited by the inbuilt classes? |
A. | Code reusability |
B. | Code efficiency |
C. | Code readability |
D. | Code reusability, efficiency and readability |
Answer» E. | |
506. |
What is the use of inbuilt classes? |
A. | Provide predefined data |
B. | Provide predefined functions |
C. | Provide predefined data and functions |
D. | Provide predeclared data to be overridden |
Answer» D. Provide predeclared data to be overridden | |
507. |
In which case the classes can be used to make more efficient program? |
A. | To define a function that is called frequently in a program |
B. | To structure data that is most similar |
C. | To group the most similar data and operations |
D. | To define a blueprint that shows memory location of data |
Answer» D. To define a blueprint that shows memory location of data | |
508. |
Class is _____________ of an object. |
A. | Basic function definition |
B. | Detailed description with values |
C. | Blueprint |
D. | Set of constant values |
Answer» D. Set of constant values | |
509. |
Which among the follow is a feature of class? |
A. | Object orientation |
B. | Procedure orientation |
C. | Both object and procedure orientation |
D. | Both object and procedure orientation |
Answer» B. Procedure orientation | |
510. |
Which among the following is an advantage of using classes over structures of C? |
A. | Functions are restricted |
B. | Functions can’t be defined |
C. | Functions can also be encapsulated |
D. | Functions can have more security |
Answer» D. Functions can have more security | |
511. |
Which class represents the most abstracted information? |
A. | Nested |
B. | Derived |
C. | Enclosed |
D. | Base |
Answer» E. | |
512. |
If a database have to be maintained using OOP, to store the details of each employee in a company, which would be the best choice among the following? |
A. | Define a class to store details of each employee |
B. | Define a structure to store details of each employee |
C. | Define separate variable for each detail |
D. | Define a generic type to store string and number details |
Answer» B. Define a structure to store details of each employee | |
513. |
If a class have two data members and two functions to add those two numbers and to subtract them, which among the following is most efficient if the programmer wants to implement multiplication too? |
A. | Define a public function which multiplies two numbers |
B. | Define a public function that returns values of two data members |
C. | Define a private function which multiplies two numbers |
D. | Define a private function that returns values of two data members |
Answer» C. Define a private function which multiplies two numbers | |
514. |
To group all the brands of cars, what should be used? |
A. | Class |
B. | Structure |
C. | Function |
D. | Object |
Answer» B. Structure | |
515. |
Which among the following is the main characteristic of class? |
A. | Inheritance |
B. | Encapsulation |
C. | Polymorphism |
D. | Object creation |
Answer» C. Polymorphism | |
516. |
Deriving a class in such a way that that the base class members are not available for further inheritance is known as ___________________ |
A. | Public inheritance |
B. | Protected inheritance |
C. | Protected or private inheritance |
D. | Private inheritance |
Answer» E. | |
517. |
Which feature is not related to the derived classes among the following? |
A. | Inheritance |
B. | Encapsulation |
C. | Run time memory management |
D. | Compile time function references |
Answer» D. Compile time function references | |
518. |
The members of a derived class can never be derived. |
A. | True |
B. | False |
Answer» C. | |
519. |
How many classes can be derived from a derived class? |
A. | Only 1 |
B. | At most 1 |
C. | At least 1 |
D. | As many as required |
Answer» E. | |
520. |
If base class is an abstract class then derived class ______________ the undefined functions. |
A. | Must define |
B. | Must become another abstract class or define |
C. | Must become parent class for |
D. | Must implement 2 definitions of |
Answer» C. Must become parent class for | |
521. |
If class A is derived from another derived class B which is derived from class C, which class will have maximum level of abstraction? |
A. | Class A |
B. | Class B |
C. | Class C |
D. | All have same level of abstraction |
Answer» D. All have same level of abstraction | |
522. |
Derived class is also known as ______________ class. |
A. | Subclass |
B. | Small class |
C. | Big class |
D. | Noticeable class |
Answer» B. Small class | |
523. |
If a class is being derived using more than two base classes, which inheritance will be used? |
A. | Single |
B. | Multi-level |
C. | Hierarchical |
D. | Multiple |
Answer» E. | |
524. |
How many derived class can a single base class have? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | As many are required |
Answer» E. | |
525. |
How many types of inheritance are supported in C++ for deriving a class? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» D. 4 | |
526. |
Which members can never be accessed in derived class from the base class? |
A. | Private |
B. | Protected |
C. | Public |
D. | All except private |
Answer» E. | |
527. |
If there is a derived class in a program, how many classes must be in that program? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» C. 3 | |
528. |
Which among the following is inherited by a derived class from base class? |
A. | Data members only |
B. | Member functions only |
C. | All the members except private members |
D. | All the members of base class |
Answer» D. All the members of base class | |
529. |
Which among the following is best definition of a derived class? |
A. | A child class |
B. | A class which inherits one or more classes |
C. | A class with keyword derived |
D. | A class with more than one constructor |
Answer» C. A class with keyword derived | |
530. |
If a base class is added with few new members, its subclass must also be modified. (True/False) |
A. | True |
B. | False |
Answer» C. | |
531. |
How many base classes can a single derived class have in C++? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | As many as required |
Answer» E. | |
532. |
If a base class is inherited from another class and then one class derives it, which inheritance is shown? |
A. | Multiple |
B. | Single |
C. | Hierarchical |
D. | Multi-level |
Answer» E. | |
533. |
Can we call methods of base class using constructor of the derived class? |
A. | Yes, always |
B. | Yes, but not always |
C. | No, never |
D. | No, but we can call in some cases |
Answer» B. Yes, but not always | |
534. |
Always the base class constructors are called ___________ constructor of derived class. |
A. | Before |
B. | After |
C. | Along |
D. | According to priority of |
Answer» B. After | |
535. |
Base class have ________________ of abstraction. |
A. | Higher degree |
B. | Lower degree |
C. | Intermediate |
D. | Minimum degree |
Answer» C. Intermediate | |
536. |
If a class is enclosing more than one class, than it can be called as base class of those classes. |
A. | True |
B. | False |
Answer» C. | |
537. |
Which type of members can’t be accessed in derived classes of a base class? |
A. | Protected |
B. | Private |
C. | Public |
D. | All can be accessed |
Answer» C. Public | |
538. |
Which among the following must be in a base class? |
A. | Data members |
B. | Member functions |
C. | Access specifiers |
D. | Nothing |
Answer» E. | |
539. |
If a base class is being derived by two other classes, which inheritance will that be called? |
A. | Single |
B. | Multiple |
C. | Multi-level |
D. | Hierarchical |
Answer» E. | |
540. |
How to make a derived class a base class? |
A. | Change name of the class |
B. | Use keyword base |
C. | Make a class derive from it |
D. | Can’t be done |
Answer» D. Can’t be done | |
541. |
How many base classes can a single class inherit in java? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | As many as required |
Answer» B. 2 | |
542. |
An abstract class is always a __________ class. |
A. | Base |
B. | Derived |
C. | Template |
D. | Nested |
Answer» B. Derived | |
543. |
A base class is also known as _____________ class. |
A. | Basic |
B. | Inherited |
C. | Super |
D. | Sub |
Answer» D. Sub | |
544. |
Which is most appropriate definition of a base class? |
A. | It is parent of any of its derived class |
B. | It is child of one of the parent class |
C. | It is most basic class of whole program |
D. | It is class with maximum number of members |
Answer» B. It is child of one of the parent class | |
545. |
Template classes must have at least one static member. |
A. | True |
B. | False |
Answer» C. | |
546. |
How many generic types can be given inside a single template class? |
A. | Only 1 |
B. | Only 3 |
C. | Only 7 |
D. | As many as required |
Answer» E. | |
547. |
If template class is defined, is it necessary to use different types of data for each call? |
A. | No, not necessary |
B. | No, but at least two types must be there |
C. | Yes, to make proper use of template |
D. | Yes, for code efficiency |
Answer» B. No, but at least two types must be there | |
548. |
What if static members are declared inside template classes? |
A. | All instances will share the static variable |
B. | All instances will have their own static variable |
C. | All the instances will ignore the static variable |
D. | Program gives compile time error |
Answer» C. All the instances will ignore the static variable | |
549. |
How is function overloading different from template class? |
A. | Overloading is multiple function doing same operation, Template is multiple function doing different operations |
B. | Overloading is single function doing different operations, Template is multiple function doing different operations |
C. | Overloading is multiple function doing similar operation, Template is multiple function doing identical operations |
D. | Overloading is multiple function doing same operation, Template is same function doing different operations |
Answer» D. Overloading is multiple function doing same operation, Template is same function doing different operations | |
550. |
The _____________ class is a specialization of a more general template class. |
A. | String |
B. | Integer |
C. | Digit |
D. | Math |
Answer» B. Integer | |