Since we don't know what you're expecting, and you don't provide any feedback, the only bad thing I see here is that B extends A and it has the same variable.