This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile Error" Watch "Compile Error" New topic

Compile Error

Hanna S?derbergLarsson

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

And it gives this compile error: 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.
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

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Compile Error
jQuery in Action, 3rd edition