This is the code: I do not understand the variable location. In the interface Movable it is a public, static and final variable; in the class Donkey it is a default variable. That means the class donkey inherits a static variable and it declares an instance variable. I do not understand why there is not a conflict, both variables have the same name. How does it work?
There is an other code: It does not compile. This code compiles. The class Test inherits the public, static and final variable x; it has an instance varible x. In the first code it is not possible to have a static variable named x and an instance variable named x; it does not compile. I am looking for an explanation.
OK. I got it. What is about the other code? It seems that inheriting a static variable to a class, which has an instance variable with this name, is not a problem; probably because the static variable does not belong to the class?