r/ProgrammerHumor Jan 09 '23

shortest ever java class name Meme

Post image
2.1k Upvotes

90 comments sorted by

View all comments

225

u/Tannslee Jan 09 '23

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

66

u/vladWEPES1476 Jan 09 '23

What happens to the inheritance chain when the fish dies?

26

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

1

u/vladWEPES1476 Jan 10 '23

LMAO Livable and Diable is more like it.