Languages [3i Infotech Placement]: Sample Questions 435 - 436 of 546

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 435

Edit

Describe in Detail

Essay▾

What is a container class? What are the types of container classes?

Explanation

  • A container class
    • Hold objects in memory or external storage.
    • Acts as a generic holder.
    • Has a predefined behavior and a well-known interface.
    • Supporting class for hiding the topology used for maintaining the list of objects in memory.
    • There are two type of container classes in c ++ , namely
    • When a container class contains a group of mixed objects, the container is called a heterogeneous container;
  • When the container is holding a group of objects that are all the same, the container is called a homogeneous container.
Given the Image is Heterogeneous and Homogeneous Container Classes

Question 436

Edit

Describe in Detail

Essay▾

What are virtual classes?

Explanation

Understanding of Virtual Class
  • A virtual class is inner class whose functions and member variables can be overridden and redefined by subclasses of the outer class.
  • Analogous to virtual functions.
  • Run time type of a virtual class depends on the run time type of an object of the outer class.
  • A run-time instance-type of the outer class object not only decides polymorphic type of its own object, but also the whole family tree of virtual class members.

Developed by: