Which of the following statement is correct?
A. C++ allows static type checking.
B. C++ allows dynamic type checking.
Which of the following factors supports the statement that reusability is a desirable feature of a language?
A. It decreases the testing time.
B. It lowers the maintenance cost.
Which of the following is a mechanism of static polymorphism?
A. Operator overloading
B. Function overloading
C. Templates
What happens if the base and derived class contains definition of a function withsame prototype?
Base class object will call base class function and derived class object will call derived class function.
In which of the following a virtual call is resolved at the time of compilation?
A. From inside the destructor.
B. From inside the constructor.
Which one of the following is the correct way to declare a pure virtual function?
virtual void Display(void) = 0;
Which of the following keyword is used to overload an operator?
operator
What will happen if a class is not having any name?
A. It cannot have a destructor.
B. It cannot have a constructor.
What is friend function?
Friend function can access public data members of the class.
Friend function can access protected data members of the class.
Friend function can access private data members of the class.
Which of the following is used to make an abstract class?
A. Declaring it abstract using static keyword.
B. Declaring it abstract using virtual keyword.
C. Making at least one member function as virtual function.
D. Making at least one member function as pure virtual function. (Ans D)
What is correct about the static data member of a class?
A. A static member function can access only static data members of a class.
B. A static data member is shared among all the object of the class.
C. A static data member can be accessed directly from main().
D. Both A and B. (Ans)
What will happen if a class is not having any name?
A. It cannot have a destructor.
B. It cannot have a constructor.
What is friend function?
Friend function can access public data members of the class.
Friend function can access protected data members of the class.
Friend function can access private data members of the class.
Which of the following is used to make an abstract class?
A. Declaring it abstract using static keyword.
B. Declaring it abstract using virtual keyword.
C. Making at least one member function as virtual function.
D. Making at least one member function as pure virtual function. (Ans D)
What is correct about the static data member of a class?
A. A static member function can access only static data members of a class.
B. A static data member is shared among all the object of the class.
C. A static data member can be accessed directly from main().
D. Both A and B. (Ans)
No comments:
Post a Comment