PG TRB COMPUTER INSTRUCTOR GRADE 1 STUDY MATERIAL - 05

1. Overloaded functions in C++ oops are

A.  Functions preceding with virtual keywords.

B.  Functions inherited from base class to derived class.

C.  Two or more functions having same name but different number of parameters or type.

D.  None of above

2. Correct way to declare pure virtual function in a C++ class is

A.  virtual void foo() =0 ;

B.  void virtual foo()= { 0 }

C.  virtual void foo() {} = 0;

D.  None of these

3. Compile time polymorphism in C++ language are

A.  Operator overloading

B.  Function overloading

C.  Function overriding

D.  A & B

4. C++ abstract class can contain

A.  Pure virtual function

B.  Non-virtual function

C.  Only pure virtual function

D.  Both pure virtual and non-virtual function

5. False statements about function overloading is

A.  Defining multiple functions with same name in a class is called function overloading

( B) Overloaded function must differ in their order and types of arguments.

C.  Overloaded functions should be preceded with virtual keyword

D.  No statement is false

6. Following keyword is used before a function in a base class to be overridden in derived class in C++.

A.  override

B.  virtual

C.  void

D.  none of these

7. Which of the following cannot be overloaded in C++?

A.  Increment operator

B.  Constructor

C.  Destructor

D.  New and delete operator

8. Which is the correct declaration of pure virtual function in C++.

A.  virtual void func = 0;

B.  virtual void func() = 0;

C.  virtual void func(){0};

D.  void func() = 0;

9. In a class, pure virtual functions in C++ is used

A.  To create an interface

B.  To make a class abstract

C.  To force derived class to implement the pure virtual function

D.  All the above

10.The memory address of the first element of an array is called

A.  floor address

B.  foundation address

C.  first address

D.  base address
Previous Post Next Post