zoukankan      html  css  js  c++  java
  • C++ OOP Concept 2错题

    4. Out of the following, which is not a member of the class?
    a) Static function
    b) Friend function
    c) Constant function
    d) Virtual function

    A:Friend function is not a member of the class. They are given the same access rights as the class member function have but they are not actual members of the class.

    7. Why references are different from pointers?
    a) A reference cannot be made null
    b) A reference cannot be changed once initialized
    c) No extra operator is needed for dereferencing of a reference
    d) All of the mentioned

    A:References cannot be made null whereas a pointer can be. References cannot be changed whereas pointers can be modified.
    Pointers need * operator to dereference the value present inside it whereas reference does not need an operator for dereferencing.

    8. Which of the following provides a programmer with the facility of using object of a class inside other classes?
    a) Inheritance
    b) Composition
    c) Abstraction
    d) Encapsulation

    A:The concept of using objects of one class into another class is known as Composition.

    There are two types of polymorphism in C++ namely run-time and compile-time polymorphisms.Run-time polymorphism is implemented using Inheritance and virtual in which object decides which function to call.Compile-time polymorphism is implemented using templates in which the types(which can be checked during compile-time) are used decides which function to be called.

    13. Which concept means the addition of new components to a program as it runs?
    a) Data hiding
    b) Dynamic binding
    c) Dynamic loading
    d) Dynamic typing

    A:Dynamic loading is the concept of adding new components to a program as it runs.

    14. Which of the following explains the overloading of functions?
    a) Virtual polymorphism
    b) Transient polymorphism
    c) Ad-hoc polymorphism
    d) Pseudo polymorphism

    A:Ad-hoc polymorphism is a type of polymorphism in which a function denotes heterogeneous implementation depending upon the types of argument.

  • 相关阅读:
    2019/3/20统计单词数
    2019/3/20日历问题
    2019/3/20计算器1
    2019/3/17素数因子
    2019/3/17日历问题2
    2019/2/14多项式输出
    2019/2/13打印华氏温度与摄氏温度对照表
    2019/2/12孪生素数
    2019/2/12开灯问题
    2019/2/11 6084问题
  • 原文地址:https://www.cnblogs.com/hhlys/p/13062845.html
Copyright © 2011-2022 走看看