I know that it is not recommended, but why can I declare a member variable of an interface not static?
And what is the difference between a static and a not static member of an interface? I see that if I define an interface member variable as static, I can use it in the implementing class in a not-static way:
Interface:
public interface Pinuz {
final static int a;
public void method1();
}
Implementing class:
public class Test implements Pinuz {
public static void main(String[] args) {
Test t = new Test();
int b = t.a;
}
@Override
public void method1() {
// TODO Auto-generated method stub
}
}
I see only a warning asking me to use the member a in a static way.