i am trying to implement interface, and static method cannot be called
in non static method. So my one class is public static void main and
other is non-static.
Test file -----------------
public class Test {
public static void main(String args[]) {
byte [] encoded =Round.doOneRound(data,key);
}
Round -----------
public interface Round {
public byte[/*8*/] doOneRound( byte[/*8*/] data, byte[/*6*/] key );
/*public byte[/*8*/] doOneRound( byte[/*8*/] data, byte[/*6*/] key )
So the error i m getting is non static method doOneRound cannot be
referrenced from a static cor
please help me debug..
Oliver Wong - 18 Sep 2006 22:52 GMT
>i am trying to implement interface, and static method cannot be called
> in non static method. So my one class is public static void main and
[quoted text clipped - 19 lines]
>
> please help me debug..
You need to take a step back and go back to the basics. Your terminology
is all wrong (e.g. "my one class is public static void main"), and you seem
to have misunderstood the conceptual purpose of interfaces. If you have a
textbook, I suggest you slow down and go back to the last exercise that you
managed to solve and start from there. If you don't have a textbook, maybe
you should work through http://java.sun.com/docs/books/tutorial/
- Oliver