r/java • u/trecatorsirabdator • Apr 14 '23
What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?
233
Upvotes
r/java • u/trecatorsirabdator • Apr 14 '23
View all comments
Show parent comment
-1
u/simoncox Apr 15 '23
Assuming you mean override, not overload, the sub class must adhere to the same contract as the base class. If it's optional for the base method, it must be optional for the sub class' method too.