Sail E0 Webinar

MCQs

Total Questions : 30 | Page 3 of 3 pages
Question 21. Which is called on allocating the memory for array of objects?
  1.    destructor
  2.    constructor
  3.    method
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> constructor


When you allocate memory for an array of objects, the default constructor must be called to construct each object. If no default constructor exists, you're stuck needing a list of pointers to objects.


Question 22. Which is similar to template specialization?
  1.    template
  2.    function overloading
  3.    function template overloading
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> function template overloading


function template overloading


Question 23. How many types of specialization are there in c++?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option B. -> 2


There are two types specialization. They are full specialization and partial specialization.


Question 24. What is other name of full specialization?
  1.    explicit specialization
  2.    implicit specialization
  3.    function overloading template
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> explicit specialization


explicit specialization


Question 25. Which is dependant on template parameter?
  1.    base class
  2.    abstract class
  3.    method
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> base class


base class


Question 26. Which value is placed in the base class?
  1.    derived values
  2.    default type values
  3.    both a & b
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> default type values


We can place the default type values in a base class and overriding some of them through derivation.


Question 27. Which is used to get the input during runtime?
  1.    cout
  2.    cin
  3.    coi
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> cin


cin is mainly used to get the input during the runtime.


Question 28. How many bits of memory needed for internal representation of class?
  1.    1
  2.    2
  3.    4
  4.    no memory needed
 Discuss Question
Answer: Option D. -> no memory needed


classes that contain only type members, nonvirtual function members, and static data members do not require memory at run time.


Question 29. How many kinds of entities are directly parameterized in c++?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option C. -> 3


C++ allows us to parameterize directly three kinds of entities through templates: types, constants, and templates.


Question 30. How many kinds of parameters are there in C++?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option C. -> 3


There are three kinds of parameters are there in C++. They are type, non-type, template.


Latest Videos

Latest Test Papers