C++ Programming Questions Answers - Set 2

  • 1. What is data hiding ?

    1. It is related with hiding internal object details
    2. It is related with showing internal object details
    3. It is related with datatypes
    4. None of above
    Answer And Explanation

    Answer: Option A

  • 2. What is class in c++ ?

    1. When you define a class, you define a blueprint for a data type.
    2. When you define a class, you make get more funtionality.
    3. When you define a class, you define the logic.
    4. When you define a class, you make debugging.
    Answer And Explanation

    Answer: Option A

  • 3. What is object in C++ ?

    1. Object is part of syntax of a class.
    2. Object is datatype of a class.
    3. Object is an instance of a class.
    4. Object is function of a class.
    Answer And Explanation

    Answer: Option C

  • 4. What is purpose of abstract class ?

    1. to provide help with database connectivity.
    2. to provide data input to other classes.
    3. to provide security to other classes.
    4. to provide an appropriate base class from which other classes can inherit.
    Answer And Explanation

    Answer: Option D

  • 5. Classes that can be used to instantiate objects are called concrete classes.

    1. True
    2. False
    Answer And Explanation

    Answer: Option A

  • 6. What is default visibility mode for members of classes in C++ ?

    1. Private
    2. Public
    3. Protected
    4. Depends
    Answer And Explanation

    Answer: Option A

  • 7. Which is more memory efficient ?

    1. structure
    2. union
    3. both use same memory
    4. depends on a programmer
    Answer And Explanation

    Answer: Option B