Can’t find an answer?

Can’t find an answer?

Ask us to get the answer

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

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){  }

A base class is also known as _____________ class.

(a) Basic

(b) Inherited

(c) Super

(d) Sub

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

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

How many base classes can a single class inherit in java?

(a) 1

(b) 2

(c) 3

(d) As many as required

Always the base class constructors are called ___________ constructor of derived class.

(a) Before

(b) After

(c) Along

(d) According to priority of

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

Abstract classes can ____________________ instances.

(a) Never have

(b) Always have

(c) Have array of

(d) Have pointer of

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

Viewing 15 topics - 31 through 45 (of 54 total)

1 2 3 4
  • You must be logged in to create new topics.