File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Cattle Drive and the fly likes Compiler error... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Compiler error..." Watch "Compiler error..." New topic

Compiler error...

ryan burgdorfer
Ranch Hand

Joined: Jan 24, 2001
Posts: 219
Hopefully, someone can provide some insight into this without the code being posted:
I have a private method outside of the main method, which I am trying to call from within the main method. But when I try to compile, I get the error "Can't make static reference to method (methodname) in class Times." The method returns a String object, and also takes a String as a parameter. The only things in the program are the two methods: my private one, and the main.

<UL TYPE=SQUARE><I><LI>Ryan Burgdorfer<BR><LI>Java Acolyte</I></UL>
ryan burgdorfer
Ranch Hand

Joined: Jan 24, 2001
Posts: 219
I had to explicitly declare my method as static.
I agree. Here's the link:
subject: Compiler error...