πŸ“Š Object Oriented Programming (OOP)
Q. Under what conditions a destructor destroys an object?
  • (A) scope of existence has finished
  • (B) object dynamically assigned and it is released using the operator delete.
  • (C) program terminated.
  • (D) both a and b.
πŸ’¬ Discuss
βœ… Correct Answer: (D) both a and b.
πŸ“Š Object Oriented Programming (OOP)
Q. When class B is inherited from class A, what is the order in which the constructers of those classes are called
  • (A) class a first class b next
  • (B) class b first class a next
  • (C) class b's only as it is the child class
  • (D) class a's only as it is the parent class
πŸ’¬ Discuss
βœ… Correct Answer: (A) class a first class b next
πŸ“Š Object Oriented Programming (OOP)
Q. Variables declared in the body of a particular member function are known as data members and can be used in all member functions of the class.
  • (A) true
  • (B) false
  • (C) ---
  • (D) ---
πŸ’¬ Discuss
βœ… Correct Answer: (B) false
πŸ“Š Object Oriented Programming (OOP)
Q. In a class definition, data or functions designated private are accessible
  • (A) to any function in the program.
  • (B) only if you know the password.
  • (C) to member functions of that class.
  • (D) only to public members of the class.
πŸ’¬ Discuss
βœ… Correct Answer: (C) to member functions of that class.
πŸ“Š Object Oriented Programming (OOP)
Q. A member function can always access the data
  • (A) in the object of which it is a member.
  • (B) in the class of which it is a member.
  • (C) in any object of the class of which it is a member.
  • (D) in the public part of its class.
πŸ’¬ Discuss
βœ… Correct Answer: (A) in the object of which it is a member.
πŸ“Š Object Oriented Programming (OOP)
Q. Classes are useful because they
  • (A) can closely model objects in the real world.
  • (B) permit data to be hidden from other classes.
  • (C) bring together all aspects of an entity in one place.
  • (D) options a, b and c
πŸ’¬ Discuss
βœ… Correct Answer: (D) options a, b and c
πŸ“Š Object Oriented Programming (OOP)
Q. For the object for which it was called, a const member function
  • (A) can modify both const and non-const member data.
  • (B) can modify only const member data.
  • (C) can modify only non-const member data.
  • (D) can modify neither const nor non-const member data.
πŸ’¬ Discuss
βœ… Correct Answer: (D) can modify neither const nor non-const member data.
πŸ“Š Object Oriented Programming (OOP)
Q. Dividing a program into functions
  • (A) is the key to object-oriented programming.
  • (B) makes the program easier to conceptualize.
  • (C) may reduce the size of the program.
  • (D) option b and c
πŸ’¬ Discuss
βœ… Correct Answer: (D) option b and c

Jump to