Classes Objects interview questions – page 2

44 questions. Tap “Show answer” to check yourself.

Advertisement
  1. The class body has ___ access specifies.

    1. 1
    2. 2
    3. 3
    4. 4
    Show answer

    C. 3

  2. The members declared as ____ can only be accessed within the class.

    1. Private
    2. Public
    3. Protected
    4. Class
    Show answer

    A. Private

  3. Class comprises ____

    1. Data members
    2. Member functions
    3. Both (a) and (b)
    4. None of these
    Show answer

    C. Both (a) and (b)

  4. When objects of a class are created, separate memory is allocated for?

    1. Member functions only
    2. Member variables only
    3. Both a and b
    4. Neither functions nor variables
    Show answer

    B. Member variables only

  5. The class access specifier used to access friend function is ____

    1. Private
    2. Public
    3. Protected
    4. Both (b) and (c)
    Show answer

    B. Public

  6. Which of the following is a user defined data type?

    1. Protected
    2. Public
    3. Object
    4. Class
    Show answer

    D. Class

  7. The lifetime of a static member variable is same as ___

    1. Lifetime of the program
    2. The public variable of any object
    3. The private of variable of any object
    4. The first object of its class
    Show answer

    A. Lifetime of the program

  8. Which one of the following language features classes?

    1. C
    2. C++
    3. Basic
    4. None
    Show answer

    B. C++

  9. The return type of a member function of a class can be ____

    1. A valid C++ data type or object data type
    2. Only a valid C++ data type
    3. Only object data type
    4. None of the given
    Show answer

    A. A valid C++ data type or object data type

  10. In C++ functions are also called ___

    1. Definitions
    2. Concepts
    3. Methods
    4. Organizers
    Show answer

    C. Methods

  11. Which of the following is not a valid class specifier?

    1. Private
    2. Pointer
    3. Public
    4. Protected
    Show answer

    B. Pointer

  12. OOP stands for ___

    1. Object to Object Programming
    2. Object Oriented Programming
    3. Online Objects Programming
    4. Object Oriented Processes
    Show answer

    B. Object Oriented Programming

  13. Advertisement
  14. In a class data members are also called as ___

    1. Abstracts
    2. Attributes
    3. Properties
    4. Dimensions
    Show answer

    B. Attributes

  15. In C++, the class variables are called as ____

    1. Functions
    2. Constants
    3. Objects
    4. Methods
    Show answer

    C. Objects

Advertisement