Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

C++ - QUESTIONS : PART 5

………. Is the process of creating new classes, called derived classes from existing classes called base class.

Inheritance

 Encapsulation

 Polymorphism

 Overloading
SHOW ANSWER

If a class C is derived from class B, which is derived from class A, all through public inheritance, then a class C member function can access.

Protected and public data only in C and B

 Protected and public data only in C

 Private data in A and B

Protected data in A and B
SHOW ANSWER

Overloading the function operator

requires a class with an overloaded operator

 requires a class with an overloaded [ ] operator.

 allows you to create objects that act syntactically like functions.

 usually make use of a constructor that takes arguments.
SHOW ANSWER

What is a constructor?

A function called when an instance of a class is initialized.

 A function that is called when an instance of a class is deleted.

A special function to change the value of dynamically allocated memory

 A function that is called in order to change the value of a variable.
SHOW ANSWER

 Mechanism of deriving a class from another derived class is known as ………

Polymorphism

 Single Inheritance

Multilevel Inheritance

 Message Passing
SHOW ANSWER

RunTime Polymorphism is achieved by ……….

friend function

 virtual function

 operator overloading

 function overloading
SHOW ANSWER

Which of the following is the proper declaration of a pointer?

int x;

 int &x;

ptr x;

 int *x;
SHOW ANSWER

In multiple inheritance

the base classes must have only default constructors

 cannot have virtual functions

 can include virtual classes

 None of the above
SHOW ANSWER

for (; ??

means the test which is done using some expression is always true

 is not valid

 will loop forever

should be written as for( )
SHOW ANSWER

The compilers converts all operands upto to type of the largest operand is called as …………

typeconversion

 expression

evaluation

 precedence
SHOW ANSWER

The keyword FRIEND does not appear in

the class allowing access to another class

the class desiring access to another class

 the private section of a class

the public section of a class
SHOW ANSWER

What is the correct value to return to the operating system upon the successful completion of a program?

-1

 1

 0

 Programs do not return a value.
SHOW ANSWER

What is the only function all C++ programs must contain?

 start()

 system()

 main()

 program()
SHOW ANSWER

What punctuation is used to signal the beginning and end of code blocks?

{ }

 -> and <-

 BEGIN and END

 ( and )
SHOW ANSWER

What punctuation ends most lines of C++ code?

. (dot)

 ; (semi-colon)

 : (colon)

. ' (single quote)
SHOW ANSWER

Which of the following is a correct comment?

*/ Comments */

 ** Comment **

 /* Comment */

 { Comment }
SHOW ANSWER

Which of the following is not a correct variable type?

float

 real

 int

 double
SHOW ANSWER

Which of the following is the correct operator to compare two variables?

:=

 =

 equal

==
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in