Monday, September 27, 2021

PG TRB COMPUTER INSTRUCTOR GRADE 1 STUDY MATERIAL - 03

1. Correct way of creating an object of a class called Car is

A.  Car obj;

B.  Car *obj = new Car();

C.  Only B

D.  A & B both

2. In C++, Class object created statically(e.g. Car obj; and dynamically (Car *obj = new Car() ; ) are stored in memory

A.  Stack, heap

B.  Heap, heap

C.  Heap, stack

D.  Stack, stack

3. True statement about Class and structure in C++ is

A.  Default access specifier is private in class and public in structure

B. Way of creating objects of class and structure are different

C.  Way of inheriting class and structure are different

D.  None of these

4. In C++ programming, cout is a/an

A.  Function

B.  operator

C.  Object

D.  macro

5. Which is Abstract Data Type in C++

A.  Class

B.  Int

C.  Float

D.  array

6. Class allows only one object of it to be created though out the program life cycle

A.  Singleton class

B.  Abstract class

C.  Friend class

D.  All classes

7. Statically allocated object for class A in C++ is

A.  A *obj = new A();

B.  A obj;

C.  A obj = new A();

D.  None of these

8. When you create an object of a class A like A obj ; then which one will be called automatically

A.  Constructor

B.  Destructor

C.  Copy constructor

D.  Assignment operator

9. When you create an object of a derived class in C++

A.  Derived class constructor is called first then the base class constructor

B.  Base class constructor is called first then derived class constructor

C.  Base class constructor will not be called

D.  None of the above

10. The class in C++ which act only as a base class and object of it cannot be created is

A.  parent class

B.  super class

C.  abstract class

D.  none of the above

No comments:

Post a Comment

Popular Feed

Recent Story

Featured News