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.

  • 相关阅读:
    简单的登录验证小程序_python
    远程执行命令_python
    远程执行本地脚本_linux
    反射_python
    ssh oa项目介绍
    返回上一级过程
    ssh框架开发crm(客户关系系统总结)
    struct相对路径,绝对路径
    <s:textfield>标签回显
    ssh框架整合
  • 原文地址:https://www.cnblogs.com/hhlys/p/13062845.html
Copyright © 2011-2022 走看看