Is it possible to establish default values for inherited fields in subclasses?
Posted
by Christian Mann
on Stack Overflow
See other posts from Stack Overflow
or by Christian Mann
Published on 2010-05-22T23:56:26Z
Indexed on
2010/05/23
0:00 UTC
Read the original article
Hit count: 205
I'm trying to establish a default value for inherited fields from superclasses.
So, my class hierarchy is thus:
Character
-> Enemy
-> Boss
\
-> Hero
Each Character
has a public static char avatar
to represent him on an ASCII playing field.
How do I set a default value for the avatar
of each class inherited from Character
?
Thank you!
© Stack Overflow or respective owner