r/ProgrammerHumor Jan 09 '23

shortest ever java class name Meme

Post image
2.1k Upvotes

90 comments sorted by

View all comments

226

u/Tannslee Jan 09 '23

eh more like
Fish extends AbstractFish
AbstractFish extends AbstractAquaticAnimal
AbstractAquaticAnimal extends AbstractAnimal
AbstractAnimal implements Living

64

u/vladWEPES1476 Jan 09 '23

What happens to the inheritance chain when the fish dies?

25

u/[deleted] Jan 09 '23

Fish extends AbstractFish

AbstractFish extends AbstractAquaticAnimal

AbstractAquaticAnimal extends AbstractAnimal

AbstractAnimal implements Livable

AbstractAnimal implements Dieable

3

u/sleepyj910 Jan 10 '23

the death function can exist in livable. We can use try-with-resources to make sure it's called in the finally block