Inheritance Reading Assignment

Answers Inheritance

1. What is the base contract?
The base contract is the parent contract which is inherited. The child contract inherits the base contract.

2. Which functions are available for derived contracts?
The functions of the base contract are included in the derived contract. The base contract is compiled in bytecode and stored in the derived contract bytecode.

3. What is hierarchical inheritance?
This means that there are multiple derived contracts from one base contract.

1 Like
  1. The parent contract, that contract that is derived from.

  2. All functions are available.

  3. A single contract acts as a base for multiple inherited contracts.

1 Like
  1. The base contract is also the parent contract

  2. All internal and public scoped functions of the base contract

  3. It is similar to simple inheritance, but one parent contract serves as the base contract for multiple derived contracts

1 Like
  1. The base contracts is a contract that can be inherited by other contracts as a parent contract.

  2. All public and internal scoped functions are available for derived contracts.

  3. Hierarchical inheritance is when multiple contracts inherit from the same base contract.

1 Like
  1. What is the base contract?

The parent contract, from which functionality and data fields are inherited (by using the ‘is’ keyword).

  1. Which functions are available for derived contracts?

All the functions from the parent contract are available, except for those that use the ‘private’ visibility modifier, which are only callable from within the contract in which they are defined.

  1. What is hierarchical inheritance?

Inheritance is termed hierarchical when multiple contracts inherit from the same base contract.

2 Likes

Answer

  1. The base contract is a parent contract.

  2. Functions that are available for derived contracts are all public and internal functions, and state variables can be available to derived contracts as well.

  3. A hierarchical inheritance is a single contract acts as a base contract for multiple derived contracts.

1 Like

1.A base contract is known as a parent contract which is inherited it serves as the parent contract to the child contract which inherits contract a …, contract b is contract a.
2.hiding or allowing access to state variables directly for changing their state.
3.the parent contract acts as a base contract for multiple derived contracts.

1 Like

Answers

  1. Base contract is the parent contract into a “is-a” relationship with a child contract.

  2. Derived contracts can use all the public and internal functions of a parent contract.

  3. We can define an hierarchical inheritance when a single base contract act for different derived contract.

1 Like

the parent side of the contract

available are all public and internal functions, also all state variables

one of the contracts is the base contract for other contrancts

1 Like
  1. What is the base contract?

    The parent contract which is the contract being inherited
    from is known as the base contract.

  2. Which functions are available for derived contracts?

    All public or internal functions available in the parent
    contract are available for derived or child contracts.

  3. What is hierarchical inheritance?

    Hierarchical inheritance is when a single contract acts as a base contract for multiple derived or child contracts.

1 Like
  1. What is the base contract?

    The contract from which other contracts inherit features is known as a base contract.

  2. Which functions are available for derived contracts?

    public, internal

  3. What is hierarchical inheritance?

    This is where one class serves as a base class for more than one sub class.

1 Like
  1. The base contract is the parent contract from which a contract would inherit.
  2. The derived contract will have all functions available to it but depending on the encapsulation of the function if it may not be able to call or execute functions.
  3. The process of defining multiple contracts that are related to each other through parent-child relationships.
1 Like

What is the base contract?
A base contract is basically the foundation of the contract

Which functions are available for derived contracts?
All functions within the parent contract that are not private

What is hierarchical inheritance?
Two or more derived contracts inheriting from the same base contract but don’t inherit from each other, and these contracts can have derived contracts as well.

1 Like
  1. What is the base contract? The parent contract that is inherited by the child contract.
  2. Which functions are available for derived contracts? All public and internal scoped functions
  3. What is hierarchical inheritance? This is where a single contract acts as a base contract for multiple derived contracts
1 Like
  1. What is the base contract?
    The base contract is the parent contract which the derived contracts gets its inheritance.

  2. Which functions are available for derived contracts?
    The derived contract contains all the functionality and variables of the base contract or child contract.

  3. What is hierarchical inheritance?

This is when the base contract is used to derive two or more derived contracts

1 Like

Before answering these questions is there an error in the reading assignment when it says:
"The contract that is inherited is called the parent contract and the contract that inherits is called the child contract .
Similarly, the contract has a parent (*should this be child here) known as the derived class and the parent contract is known as a base contract .

What is the base contract?
It is the parent contract also know as what is inherited to the child or derived contract.

Which functions are available for derived contracts?
That would be all public and internal scoped functions and state variables are available but private variables are not.

What is hierarchical inheritance?

That is when one contract inherits multiple single inheritance contract.

1 Like
  1. The parent contract.
  2. Functions with the scope of public and internal.
  3. On contract derived on to another.
1 Like
  1. The base contract is the parent contract that other contracts derive from.
  2. Functions that are not private, but internal and public scoped.
  3. Hierarchical inheritance is 2 more child contracts to a parent/base contract.
1 Like
  1. The base contract, also known as the parent contract, is the contract whose traits are to be inherited.
  2. The functions available for derived contracts are those define using public and internal scope.
  3. Hierarchical inheritance means that a single contract can act as the base contract for multiple other derived contracts.
1 Like
  1. A base contract is the parent contract.

  2. The functions that are available for the derived contract are internal scoped functions and state variables.

  3. Hierarchical inheritance is something like single inheritance but this contract is a base contract for many derived contracts.

1 Like