1) Which of the Following Is Not a Type of Constructor?

1) Which of the Following Is Not a Type of Constructor?

1) Which of the following is not a type of 8) A variable defined within a block is visible constructor? A. From the point of definition onward in the A. Copy constructor program B. Friend constructor B. From the point of definition onward in the Answer:C. Default B constructor function D. Parameterized constructor C. From the point of definition onward in the Answer:block C D. Throughout the function 2) Which of the following is not the member of class? A. Static function 9) Which of the following term is used for a B. Friend function function defined inside a class? Answer:C. Const B function A. Member Variable D. Virtual function B. Member function Answer:C. Class B function D. Classic function 3) Which of the following concepts means determining at runtime what method to invoke? 10) Which of the following concept of oops A. Data hiding allows compiler to insert arguments in a B. Dynamic Typing function call if it is not specified? Answer:C. Dynamic C binding A. Call by value D. Dynamic loading B. Call by reference Answer:C. Default C arguments D. Call by pointer 4) The friend functions are used in situations where: A. We want to have access to unrelated classes 11) How many instances of an abstract class B. Dynamic binding is required can be created? C. Exchange of data between classes to take A. 1 Answer:place D B. 5 D. None of the above Answer:C. 13 D D. 0 5) The keyword friend does not appear in A. The class allowing access to another class 12) Which of the following cannot be friend? B. The class desiring access to another class A. Function Answer:C. The private C section of a class B. Class D. The public section of a class Answer:C. Object C D. Operator function 6) The term __________ means the ability to take many forms. 13) Which of the following concepts of OOPS A. Inheritance means exposing only necessary information to B. Polymorphism client? Answer:C. M emberB function A. Encapsulation D. Encapsulation B. Abstraction Answer:C. Data C hiding D. Data binding 7) C++ was originally developed by A. Clocksin and Melish B. Donald E.Knuth Answer:C. Sir D Richard Hadlee D. Bjarne Stroustrup 14) In structured programming, the problem is 21) Preventing direct access of data-members divided into various ______. of the class from outside world is known as A. modules ____. B. functions (A)Polymorphism Answer:C. structures B (B)Encapsulation D. objects Answer:(C)Data Hiding C (D) scope resolution. 15) In Object-oriented programming, the problem is divided into _____. A. classes & objects 22) What are cin and cout? B. functions (A) pointers Answer:C. structures A (B) functions D. modules Answer:(C) operator C (D) stream objects 16) A class is ____ datatype. A. primitive 23) Which header file must be included for cin B. derived and cout? Answer:C. user-defined C (A) stdio.h D. All of these (B) conio.h Answer:(C) iostream.h C (D) Both iostream.h and conio.h 17) A class is a collection of ____ and_____. (A)data-members & member functions (B)data-members, member functions and 24) Creating a new class using one or more main() existing classes is known as ____. (C) data-members, member functions,main() (A)Polymorphism Answer:and include A statements (B)Encapsulation (D)None of these Answer:(C)overloading D (D)inheritance 18) An object is ...... (A)a variable of class datatype. 25) Ability of an operator or function call to (B)same as a class. take different forms is known as ____. (C)just like a global variable. (A) Polymorphism Answer:(D)collection A of data-members and member (B) Encapsulation functions. Answer:(C) overloading A (D)inheritance 19) Wrapping up of data & functions together 26) cout is a/an __________ . in a class is known as _____. A. operator (A)Overloading B. function (B) Data Abstraction Answer:C. object C Answer:(C)Polymorphism D D. macro (D)Encapsulation 27) Which of the following concepts provides 20) Including only necessary details and facility of using object of one class inside ignoring additional details while defining a another class? class is known as ____. A. Encapsulation (A) Overloading B. Abstraction (B) Data Abstraction Answer:C. Composition C Answer:(C) Polymorphism B D. Inheritance (D) Encapsulation 34) Which of the following is correct about 28) How many types of polymorphisms are class and structure? supported by C++? A. class can have member functions while A. 1 structure cannot. B. 2 B. class data members are public by default Answer:C. 3 B while that of structure are private. D. 4 C. Pointer to structure or classes cannot be declared. Answer:D. class data D members are private by default 29) Which of the following is an abstract data while that of structure are public by default. type? A. int B. double 35) Which of the following concepts means Answer:C. string D wrapping up of data and functions together? D. Class A. Abstraction B. Encapsulation Answer:C. Inheritance B 30) A __________ is a special method used to D. Polymorphism initialize the instance variable of a class. A. Member function B. Destructor 36) Which of the following concepts means Answer:C. Constructor C waiting until runtime to determine which D. Structure function to call? A. Data hiding B. Dynamic casting 31) Which of the following concepts means Answer:C. Dynamic C binding adding new components to a program as it D. Dynamic loading runs? A. Data hiding B. Dynamic typing 37) Which of the following operator is Answer:C. Dynamic D binding overloaded for object cout? D. Dynamic loading A. >> B. << Answer:C. + B 32) Which of the following statement is D. = correct? A. A constructor is called at the time of declaration of an object. 39) Which of the following is the correct class B. A constructor is called at the time of use of of the object cout? an object. A. iostream C. A constructor is called at the time of B. istream declaration of a class. Answer:C. ostream C Answer:D. A constructor A is called at the time of use of a D. ifstream class. 40) Which of the following cannot be used with 33) Which of the following approach is adapted the keyword virtual? by C++? A. class A. Top-down B. member functions B. Bottom-up Answer:C. constructorC Answer:C. Right B -left D. destructor D. Left-right 41) Which of the following functions are performed by a constructor? 47) Which one of the following options is A. Construct a new class correct? B. Construct a new object A. Friend function can access public data Answer:C. Construct D a new function members of the class. D. Initialize objects B. Friend function can access protected data members of the class. C. Friend function can access private data 42) Which of the following is the correct way of Answer:members D of the class. declaring a function as constant? D. All of the above. A. const int ShowData(void) { /* statements */ } B. int const ShowData(void) { /* statements */ 48) Which of the following statements is } correct in C++? Answer:C. int ShowData(void) C const { /* statements */ } A. Classes cannot have data as protected D. Both A and B members. B. Structures can have functions as members. Answer:C. Class members B are public by default. 43) Which of the following statement is D. Structure members are private by default. correct? A. C++ allows static type checking. B. C++ allows dynamic type checking. 49) Which of the following access specifier is C. C++ allows static member function be of used as a default in a class definition? Answer:type const. D A. protected D. Both A and B. B. public Answer:C. private C D. friend 44) Which of the following header file includes definition of cin and cout? A. istream.h 50) What is correct about the static data B. ostream.h member of a class? Answer:C. iomanip.h D A. A static member function can access only D. iostream.h static data members of a class. B. A static data member is shared among all the object of the class. 45) What will happen if a class is not having C. A static data member can be accessed any name? Answer:directly from D main(). A. It cannot have a destructor. D. Both A and B. B. It cannot have a constructor. Answer:C. It isD not allowed. D. Both A and B. 51) Which of the following provides a reuse mechanism? A. Abstraction 46) Which one of the following is correct about B. Inheritance the statements given below? Answer:C. Dynamic B binding All function calls are resolved at compile- D. Encapsulation time in Procedure Oriented Programming. All function calls are resolved at compile- time in OOPS. 53) Which of the following statement is A. Only II is correct. correct? B. Both I and II are correct. A. Class is an instance of object. Answer:C. Only C I is correct. B. Object is an instance of a class. D. Both I and II are incorrect. Answer:C. Class B is an instance of data type. D. Object is an instance of data type. 59) Inline Functions are invoked at 53) The process of building new classes from A. Run time existing one is called B. Compile time A. Structure AnswerC. Depends: B on how it is invoked B. Inheritance D. Both b and c above Answer:C.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    13 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us