So its been 4 long years ever since I'm not working in Java ( all these years i was in PHP/Perl/Python and Cold fusion and I'm an SCJP). I was planning to shift to Java again and started reading my old certification book this morning.
I'm stuck at one point.
It is correct that interfaces define constants. But can a class which implements that interface override (or shadow) that variable?
in other words will the below code execute without any error?
And what if I want the values of both the variables in the above code without changing the variable name?
(I know being an SCJP I should know this, but sorry. I'm completely out of touch )
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Joined: Nov 10, 2007
@Rob: Thanks, man. after struggling through the code for sometime, I managed to echo out two different values of that constant.. :-).
@Stephan: That code compiled but I was amazed as to how it did and I wanted to confirm whether it is shadowing or it is something else :-)