Вы находитесь на странице: 1из 4

1).

which of the function operator cannot be over loaded


a) <=
b)?:
c)==
d)*

ans: b and d

2)Which of the following is correct about constructor?


a).void type

b). return nothing

answer b

3) Can we use this pointer inside static member function?


Ans: No! The this pointer cannot be used inside a static member function. This is because
a static member function is never called through an object.

4)Can we declare a static function as virtual?


Ans: No. The virtual function mechanism is used on the specific object that determines
which virtual function to call. Since the static functions are not any way related to
objects, they cannot be declared as virtual.

5)What are C++ storage classes?

auto
register
static
extern

6) mutable is used for


ans--changing the value in the
const functions

7) #defines macro(a) ((a++) + (++a) + (a++))


Main()
{
cout << macro(1);
}
Ans. 4
8) Which casting is done at run time
Ans. dynamic_cast

9) The standard c++ comment


/ // /* and */ None of these
Ans : 2

10) The preprocessor directive #include is required if


Both console
Console output is Console input is
input and output is None of these
used used
used
Ans : 3

11) The operator << is called


an insertion
put to operator either a or b None of these
operator
Ans : 3

12) When a language has the capability to produce new data type, it is called
Extensible Overloaded Encapsulated Reprehensible
Ans : 1

13) The C++ symbol <<


perform the
action of sending the
is used to indicate
value of expression is adopted to
the action from right All the above
listed as its right to resemble an arrow
to left
the outputs strewn as
the left.
Ans : 4

14) What is a reference?


a reference is an used to rename an
an operator None of these
alias for an object object
Ans : 2

15) A constructor is called whenever


a object is
an object is used a class is declared a class is used
declared
Ans : 1
16) State the object oriented languages
C++ Java Eiffel All of the above
Ans : 4

17) Overload function in C++


functions with
all have the same
a group function same name and same
number and type of All of the above
with the same name number and type of
arguments
arguments
Ans : 1

18) Operator overloading is


making c++ giving new
making new c++
operators works with meaning to existing both a& b above
operator
objects c++ operators
Ans : 4

19) A class having no name


can't have a can't have a can't be passed as
is not allowed
constructor destructor an argument
Ans : 3

20) In C++ a function contained with in a class is called


a member
an operator a class function a method
function
Ans : 1

21) The fields in a class of a c++ program are by default


protected public private None of these
Ans : 3

22) Which holds true for the following statement


class c: public A, public B
a) 2 member in class A, B should not have same name
b) 2 member in class A, C should not have same name
c) both
d) none
Ans. (a)

23)Base class has some virtual method and derived class has a method with the same
name. If we initialize the base class pointer with derived
object,. calling of that virtual method will result in which method being called?
a. Base method
b. Derived method..

Ans. b

Вам также может понравиться