Two Laptop Bag*
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 Android Security Essentials Live Lessons this week in the Android 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.
jQuery in Action, 2nd edition
subject: Compiler error...
Similar Threads
private class
Variable initialization
problems running code
Why does private static void main(String[] args) work???????
What would cause this error???