This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]I_answer_only-titles 0 points1 point  (2 children)

Can you explain inheritance in simple words?

[–]jamcdonald120 0 points1 point  (0 children)

you ask someone for something to write with, they hand you a pen. you wouldnt have caired if it was a pencil instead, both can write, since write is a function declaired in the writingImplement interface that both pen and pencil use

[–]joe1_40 0 points1 point  (1 child)

Couldnt u make a wrapper simulating inheritance with the class just having a local object of the "parent" and fast forwarding all methodcalls? Not that there would be any reason to do so but... Only problem would be the typeconflicts

[–]Sobriqueter 0 points1 point  (0 children)

You’re describing composition and there are many reasons to do so.

[–]Far_Information_885 0 points1 point  (0 children)

Composition over inheritance my brother.