XOOPS/OOPs MCQs Set 2 Sample Test,Sample questions

Question:
 The syntax is given below shows which type of inheritance?

18.	class A { 
... .. ... }; 
class B: public A { 
... .. ... }; 
class C: public B { 
... ... ... };

1.Hierarchical inheritance

2.Hybrid inheritance

3.Multilevel inheritance

4.Multiple inheritances


Question:
 What are private constructors?A private constructor is a special instance constructor.
Private constructors are the constructors which can be used on the object without being explicitly defined.

1.Only (i)

2.Only (ii)

3.Both (i) and (ii) .

4.There is no concept of private cons


Question:
 Which of the following statement is not true for virtual functions?

1.The virtual function must be members of some class

2.The virtual function can be a static member

3.Virtual functions are accessed by using an object pointer

4.The virtual function can be a friend of another class


Question:
A class containing one or more pure virtual functions is known as ____?

1.Abstract class

2.Static class

3.Instance class

4.None of these


Question:
Are aggregation and generalization the same thing?

1.Yes

2.No

3.Error

4.None of these


Question:
Can a destructor be virtual?


1.yes

2.No

3.Error

4.None of these


Question:
Can we create an object of abstract class type?



1.Yes

2.No

3.Error

4.None


Question:
Does an exception occur?

Runtime
Compile-time
Select the correct option?

1.Only i

2.Only ii

3.Both i and ii

4.None of these


Question:
Early binding is also known as____?

1.Dynamic binding

2.Late binding

3.Static binding

4.Run time binding


Question:
Friend Functions cannot access the private data of other class'. Is this statement true or false?

1.True

2.False

3.Error

4.None of these


Question:
How many types of associations are there?

1.2 types

2.3 types

3.4 types

4.It does not have any type


Question:
How many types of functions are there in an object-oriented programming language?

1.4 types

2.5 types

3.2 types

4.6 types


Question:
How many types of parameter parsing does C++ support?

1.2 types

2.3 types

3.4 types

4.5 types


Question:
How many types of valid inheritance are there?

1.4 types

2.5 types

3.6 types

4.3 types


Question:
If the base class is inherited privately then the public members of the base class become protected members of the derived class and the protected members of the base class become public members of the derived class?
Is this statement True or False?

1.True

2.False

3.Error

4.None of these


Question:
If the virtual function is defined in the base class, it needs not be necessarily redefined in the derived class.
Is this statement true or false?


1.True

2.False

3.Error

4.None of the above


Question:
If there are different sections of an organization such as IT, computer science, Civil, Mechanical, etc. Each organization has the same attributes such as student name, roll number, year, etc. which comes under a class Student then this comes under which type of inheritance?

1.Hierarchical inheritance

2.Hybrid inheritance

3.Multilevel inheritance

4.Multiple inheritances


Question:
If two functions with the same name have different prototypes, C++ considers them as ____?

1.Friend Function

2.Overloaded function

3.Abstract function

4.Operator overloading function


Question:
In which type of inheritance does one class act as a superclass for more than one sub-class?

1.Hybrid inheritance

2.Multiple inheritances

3.Hierarchical inheritance

4.Multilevel inheritance


Question:
In which type of inheritance the child or derived class inherits the features of the superclass and simultaneously this child class acts as a superclass for another derived class?

1.Hybrid inheritance

2.Multiple inheritances

3.Hierarchical inheritance

4.Multilevel inheritance


Question:
Select the correct operator which cannot be overloaded.


1.Scope Resolution Operator (::)

2.Ternary Operator (? :)

3.Member Access or Dot Operator (.)

4.All of the above


Question:
State the correct syntax of a friend function.

1.Class ABC{ ***** Friend public: ***** Void xyz(); }

2.Class ABC{ ***** public: ***** Friend Void xyz(); }

3.Class ABC{ ***** Friend public: ***** Friend Void xyz(); }

4.Class ABC{ ***** public::friend() ***** Friend Void xyz(); }


Question:
State whether a statement is true or false?
Derived classes cannot be built from abstract classes

1.True

2.False

3.Error

4.None of These


Question:
The default visibility mode in inheritance is ____?

1.Protected

2.Public

3.Private

4.None of These


Question:
The scope resolution operator is used to ____ function in the Inheritance.

1.Overload

2.Override

3.both (a) and (b)

4.None of these


Question:
The _____ constructor is invoked when an object is passed by value to a function.

1.Parameterized Constructor

2.Default Constructors

3.Copy Constructor

4.None of these


Question:
Virtual inheritance is also known as ____.





1.Clear inheritance

2.Private inheritance

3.Disinheritance

4.Multiple inheritances


Question:
What is early binding?

1.Early binding simply means that an object is bound to its function call at compile time

2.Early binding simply means that an object is bound to its function call at runtime

3.both (a) and (b)

4.None of These


Question:
When we override an inherited method in a subclass, we can _____ its access but not ____ it?



1.Increase, decrease

2.Decrease, increase

3.Error

4.None of these


Question:
Which class is mainly designed to overcome the disadvantage of multiple inheritances?

1.Virtual Base class

2.Base class

3.Abstract class

4.Partial class


Question:
Which concept of object-oriented programming language does not use base class and derived class?



1.Polymorphism

2.Over ridding

3.Abstraction

4.None of these


Question:
Which function is not a member of a class but still has access to private data of a class?

1.Friend Function

2.Pure Virtual Function

3.Static Function

4.Abstract Function


Question:
Which one of the following is not the characteristic of a constructor?

1.Constructors can be virtual

2.Constructors cannot be referred by their address

3.Constructors cannot be inherited

4.Constructors are called automatically


Question:
Which one of the following is the main benefit of single inheritance?




1.Presence of ambiguity

2.Absence of ambiguity

3.Provides modularity

4.Does not provide modularity


Question:
Which operator is used to access the static variable and static function of a class?

1.Scope Resolution Operator (::)

2.Ternary Operator (? :)

3.Member Access or Dot Operator (.)

4.All of the above


Question:
Which statement tells the correct difference between Exception and Error?

1.An exception cannot be recovered. Errors can be recovered.

2.An exception can be recovered. Errors cannot be recovered.

3.both (a) and (b)

4.None of these


Question:
__ is associated with polymorphism and inheritance.

1.Message parsing

2.Abstraction

3.Dynamic Binding

4.Encapsulation


Question:
___ Function is a function declared in a base class that has no definition relative to the base class.

1.Virtual Function

2.Pure Virtual Function

3.Friend Function

4.Static Function


Question:
___ is the relationship between a class and one or more refined versions of it.

1. Special inheritance

2.Generalization

3.Inheritance

4.None of These


Question:
___ refers to the ability to perform operations without knowing the type of object they'll be operated on.

1.Abstract base class

2.Abstract class

3.Polymorphism

4.Operator overloading


Question:
____ is a mechanism that helps us to get compile-time polymorphism.


Yes
No

1.Function Overloading

2.Function Overriding

3.Error

4.None of these


More MCQS

  1. OOPs MCQs Set 1
  2. OOPs MCQs Set 2
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!