Hi all,
Will somebody please put me straight on the following issue ?
What are the valid modifiers for variables declared within an interface definition ?
I've read that "The only fields allowed in an interface definition are contstants that are declared both static and final" - page 113 of O'Reilly's '
Java in a nutshell'.
And yet the following simple code compiles OK ???
public interface MyInterface {
char c = 'c';
public void method1();
public void method2();
}
What am I missing, is the variable implicitly assumed to be a constant ( static final) ?
Also, how deeply does the programmer exam delve into the declaration and use of interfaces ?
Cheers, Mark.