I'm beginner to java.I just recently learned about inheritance between classes. I know that if I inherit from a class,I can use those fields and methods,and also the objects I create will have those. But what about static fields and methods?
From what I tested,if I inherit a static field and change it(is not final),it will change also in parent class(and maybe in other ancestors).This is weird,or it's the way it should be?
It's like I have mammals and dolphins(and maybe other mammals).I want to know the number of dolphins,and the number of mammals to change when I add a dolphin.And this static field "nr" to be inherited.How can I get around this?