Sail E0 Webinar

MCQs

Total Questions : 30 | Page 2 of 3 pages
Question 11. What does your class can hold?
  1.    data
  2.    functions
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option C. -> both a & b


The classes in c++ are used to manipulate both data and functions.


Question 12. Which other keywords are also used to declare the class other than class?
  1.    struct
  2.    union
  3.    object
  4.    both a & b
 Discuss Question
Answer: Option D. -> both a & b


Struct and union take the same definition of class but differs in the access techniques.


Question 13. How many kinds of classes are there in c++?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option B. -> 2


There are two kinds of classes in c++. They are absolute class and concrete class.


Question 14. Which is used to define the member of a class externally?
  1.    :
  2.    : :
  3.    #
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> : :


: :


Question 15. How many specifiers are present in access specifiers in class?
  1.    1
  2.    2
  3.    3
  4.    4
 Discuss Question
Answer: Option C. -> 3


There are three types of access specifiers. They are public, protected and private.


Question 16. The fields in the class in c++ program are by default
  1.    protected
  2.    private
  3.    public
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> private


private


Question 17. Constructors are used to
  1.    initalize the objects
  2.    construct the data members
  3.    both a & b
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> initalize the objects


Once the object is declared means, the constructor are also declared by default.


Question 18. Which of the following is a valid class declaration?
  1.    class A { int x; };
  2.    class B { }
  3.    public class A { }
  4.    object A { int x; };
 Discuss Question
Answer: Option A. -> class A { int x; };


class A { int x; };


Question 19. Which class is used to design the base class?
  1.    abstract class
  2.    derived class
  3.    base class
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> abstract class


abstract class


Question 20. When struct is used instead of the keyword class means, what will happen in the program?
  1.    access is public by default
  2.    access is private by default
  3.    access is protected by default
  4.    none of the mentioned
 Discuss Question
Answer: Option A. -> access is public by default


access is public by default


Latest Videos

Latest Test Papers