Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

static and non static

Thread view: 
niraliu@gmail.com - 18 Sep 2006 22:14 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
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.