Interview questions

Computer interview questions – page 70

3,888 questions. Tap “Show answer” to check yourself.

  1. Class access specifiers are also known as ____

    1. A.Specifications
    2. B.Class depth
    3. C.Visibility labels
    4. D.None of these
    Show answer

    C. Visibility labels

  2. ____ are the functions that perform specific task in a class.

    1. A.Data functions
    2. B.Concrete functions
    3. C.Member functions
    4. D.Data members
    Show answer

    C. Member functions

  3. The class body has ___ access specifies.

    1. A.1
    2. B.2
    3. C.3
    4. D.4
    Show answer

    C. 3

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

    1. A.Private
    2. B.Public
    3. C.Protected
    4. D.Class
    Show answer

    A. Private

  5. Class comprises ____

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

    C. Both (a) and (b)

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

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

    B. Member variables only

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

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

    B. Public

  8. Which is the base class of the class heavy_vehicle?

    1. A.Bus
    2. B.Heavy_vehicle
    3. C.Vehicle
    4. D.Both (a) and (c)
    Show answer

    C. Vehicle

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

    1. A.Protected
    2. B.Public
    3. C.Object
    4. D.Class
    Show answer

    D. Class

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

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

    A. Lifetime of the program

  11. Which one of the following language features classes?

    1. A.C
    2. B.C++
    3. C.Basic
    4. D.None
    Show answer

    B. C++

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

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

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

  13. Private, public and protected are all ____

    1. A.Access specifiers
    2. B.C++ variables
    3. C.Control structures of C++
    4. D.Derived class members
    Show answer

    A. Access specifiers

  14. Which is not inherited from the base class?

    1. A.Data members
    2. B.Constructor
    3. C.Function
    4. D.Object
    Show answer

    B. Constructor

  15. When a class is derived by access specifier public, the protected members of base class are derived as ____ of derived class.

    1. A.Private members
    2. B.Public members
    3. C.Protected members
    4. D.None
    Show answer

    C. Protected members

  16. When a sub class inherits only from one base class, it is known as ___

    1. A.Single inheritance
    2. B.Double inheritance
    3. C.Hierarchical inheritance
    4. D.None
    Show answer

    A. Single inheritance

  17. In inheritance, the newly created classes are ___

    1. A.Function
    2. B.Super class
    3. C.Derived class
    4. D.Base class
    Show answer

    C. Derived class

  18. The default visibility mode while inheriting members of a base class is ____

    1. A.Extended public
    2. B.Public
    3. C.Protected
    4. D.Private
    Show answer

    D. Private

  19. Single, multiple, multilevel, hybrid and hierarchical are all types of ____

    1. A.Overloading
    2. B.Encapsulation
    3. C.Inheritance
    4. D.Polymorphism
    Show answer

    C. Inheritance

  20. When a class is inherited by public visibility mode the public members of base class are derived as ____ of derived class.

    1. A.Public members
    2. B.Protected members
    3. C.Private members
    4. D.None
    Show answer

    A. Public members

  21. Classes used only for deriving other classes are called ___

    1. A.Abstract classes
    2. B.Derived classes
    3. C.Public classes
    4. D.Objects
    Show answer

    A. Abstract classes

  22. A derived class that inherits from multiple base class is known as ____

    1. A.Single inheritance
    2. B.Multiple inheritance
    3. C.Multilevel inheritance
    4. D.Hybrid inheritance
    Show answer

    B. Multiple inheritance

  23. The process of creating new data types from existing data type is called as ____

    1. A.Encapsulation
    2. B.Overloading
    3. C.Polymorphism
    4. D.Inheritance
    Show answer

    D. Inheritance

  24. In inheritance, protected members of base class are inherited as ____ when private access specifier is used.

    1. A.Public members
    2. B.Private members
    3. C.Protected members
    4. D.Not inherited at all
    Show answer

    B. Private members

  25. Reusability of code, code sharing, consistency of interface are all advantages of ____

    1. A.Encapsulation
    2. B.Inheritance
    3. C.Polymorphism
    4. D.Overloading
    Show answer

    B. Inheritance

  26. The class created from an existing base class is called ___

    1. A.Second class
    2. B.New class
    3. C.Derived class
    4. D.Rich class
    Show answer

    C. Derived class

  27. The class from which the other classes are derived is called as ____

    1. A.Objects
    2. B.Functions
    3. C.Sub-class
    4. D.Object class
    Show answer

    B. Functions

  28. In C++ functions are also called ___

    1. A.Definitions
    2. B.Concepts
    3. C.Methods
    4. D.Organizers
    Show answer

    C. Methods

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

    1. A.Private
    2. B.Pointer
    3. C.Public
    4. D.Protected
    Show answer

    B. Pointer

  30. OOP stands for ___

    1. A.Object to Object Programming
    2. B.Object Oriented Programming
    3. C.Online Objects Programming
    4. D.Object Oriented Processes
    Show answer

    B. Object Oriented Programming

Companies that ask Computer questions