Cpp Programming 73 – Which of the following is the correct class of the object cout?
Question: Which of the following is the correct class of the object cout? [A]. iostream [B]. istream[C]. ostream [D]. ifstream Answer: Option C
Question: Which of the following is the correct class of the object cout? [A]. iostream [B]. istream[C]. ostream [D]. ifstream Answer: Option C
Question: 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].…
Question: What happens if the base and derived class contains definition of a function with same prototype? [A]. Compiler reports an error on compilation. [B]. Only base class function will get called irrespective of object.[C]. Only derived class function will…
Question: Which of the following statements is correct in C++? [A]. Classes cannot have data as protected members. [B]. Structures can have functions as members.[C]. Class members are public by default. [D]. Structure members are private by default. Answer: Option…
Question: cout is a/an __________ . [A]. operator [B].function [C]. object[D]. macro Answer: Option C
Question: Which of the following provides a reuse mechanism? [A]. Abstraction [B]. Inheritance[C]. Dynamic binding [D]. Encapsulation Answer: Option B
Question: Which of the following problem causes an exception? [A]. Missing semicolon in statement in main(). [B]. A problem in calling function.[C]. A syntax error. [D]. A run-time error. Answer: Option D
Question: Which of the following ways are legal to access a class data member using this pointer? [A]. this->x [B]. this.x[C]. *this.x [D]. *this-x Answer: Option A
Question: Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object. [A]. Inheritance [B]. Polymorphism[C]. Abstraction [D]. Encapsulation Answer: Option B
Question: What will happen if a class is not having any name? [A]. It cannot have a destructor. [B]. It cannot have a constructor.[C]. It is not allowed. [D]. Both A and B. Answer: Option D