Is there any way to initialize member variables of a subclass in Java before the superclass' constru

Posted by kahoon on Stack Overflow See other posts from Stack Overflow or by kahoon
Published on 2010-03-27T14:28:44Z Indexed on 2010/03/27 14:33 UTC
Read the original article Hit count: 236

I need this because the constructor in the superclass is calling a method which is overridden in the subclass. The method returns a value which is passed to the subclass' constructor. But the superclass constructor must be called before the subclass constructor, so I have no chance to save the value passed in.

© Stack Overflow or respective owner

Related posts about java

Related posts about object-oriented-design