Skip to content

More clarity on inheritance #182

@legoaggelos

Description

@legoaggelos

https://javabook.mccue.dev/class_extension/inheritance
even so late in the book, inheritance is still a challenge. id probably add a sentence or two, elaborating on what happens.
saying that a Ocean is considered to be a BodyOfWater, consequently it contains depth and swim. And hence, constructing a new Ocean(...) means it first needs to construct its BodyOfWater part and thats what the super(depth) in the constructor does.
I.e. it calls the BodyOfWater constructor
i understand u prob dont want to get too technical and thats fine. but it should probably elaborate just a bit on the topic to make clearer what this all means

originally suggested in the TJ discord by zabuzard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions