Programming In C++ (3330702) MCQs

MCQs of Inheritance

Showing 1 to 10 out of 34 Questions
1.

A class whos objects can not be created is known as _____

(class કે જેના objects બનાવી શકાતા નથી તે _____ તરીકે ઓળખાય છે)

(a)

Absurd Class

 

(b)

Dead Class

 

(c)

Super Class

 

(d)

Abstract Class

 

Answer:

Option (d)

2.

Reusability of code in C++ is achieved through ____

(C++ માં કોડ નો ફરીથી ઉપયોગીતા ____ દ્વારા પ્રાપ્ત થાય છે)

(a)

Polymorphism

(b)

Inheritance

(c)

Encapsulation

(d)

Polymorphism and Inheritance

Answer:

Option (b)

3.

Where is the derived class is derived from?

(derived class ક્યાંથી derived થાય છે?)

(a)

derived

(b)

base

(c)

both derived & base

(d)

class

Answer:

Option (b)

4.

Which constructor will initialize the base class data member?

(કયા કન્સ્ટ્રક્ટર base class ના data member ને initialize કરશે?)

(a)

derived class

 

(b)

base class

(c)

class

(d)

derived & base class

Answer:

Option (b)

5.

What is meant by multiple inheritance?

(multiple inheritance થી શું થાય છે?)

(a)

Deriving a base class from derived class

(derived class માંથી base class મેળવવો)

(b)

Deriving a derived class from base class

(base class માંથી derived class મેળવવો)

(c)

Deriving a derived class from more than one base class

(એકથી વધુ base class માંથી derived class બનાવવો)

(d)

Deriving a derived base class

(derive કરેલો બેઝ ક્લાસ બનાવવો)

Answer:

Option (c)

6.

Which symbol is used to create multiple inheritances?

(કયો symbol એ multiple inheritances બનાવવા માટે વપરાય છે?)

(a)

Dot

(b)

Comma

(c)

Dollar

(d)

star

Answer:

Option (b)

7.

What is Inheritance in C++?

(C++ માં Inheritance શું છે?)

(a)

Wrapping of data into a single class

(એક જ class માં data ને Wrap કરવા)

(b)

Deriving new classes from existing classes

(exist classes માંથી નવા classes  મેળવવામાં)

(c)

Overloading of classes

(classes નું Overloading )

(d)

Classes with same names

(same name વાળા Classes )

Answer:

Option (b)

8.

Which specifier makes all the data members and functions of base class inaccessible by the derived class?

(કયા specifier બધા data members અને base class ના functions ને derived class દ્વારા inaccessible બનાવે છે?)

(a)

private

(b)

protected

(c)

public

(d)

both private and protected

Answer:

Option (a)

9.

We can create objects of the abstract class.

આપણે abstract class નો objects બનાવી શકીએ છીએ?

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

10.

During a class inheritance in CPP, if the visibility mode or mode of derivation is not provided, then by default visibility mode is  ___________.

CPP માં class ના inheritance દરમિયાન, જો visibility mode અથવા derivation નો mode provide કરવામાં આવતો નથી, તો default visibility mode ___________ હોઈ છે.

(a)

public

(b)

protected

(c)

private

(d)

Friend

Answer:

Option (c)

Showing 1 to 10 out of 34 Questions