File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiler error...

 
ryan burgdorfer
Ranch Hand
Posts: 219
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
~Ryan
 
ryan burgdorfer
Ranch Hand
Posts: 219
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AHA...
I had to explicitly declare my method as static.
Duh.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic