aspose file tools*
The moose likes Beginning Java and the fly likes Compile Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile Error" Watch "Compile Error" New topic
Author

Compile Error

Hanna S?derbergLarsson
Greenhorn

Joined: Feb 01, 2003
Posts: 2
Hello!
I have the following class:

And it gives this compile error:
BumpTest.java:4:In this static context "this" is not accessible (no instance field or method)
Please tell me why!!!
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
bumper() is a member of the class, so you can't access it from the static main method. Make bumper static.
Or make an instance of the class and invoke bumper() on the instance.
-Barry
BTW you have another problem with that method, but first get it to compile and run.
[ February 01, 2003: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Hanna S?derbergLarsson
Greenhorn

Joined: Feb 01, 2003
Posts: 2
Thank you Barry!
And I know about the other problem, that was what I wanted to achieve I'm doing a lot of silly tests right now!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compile Error