This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile Error

 
Hanna S?derbergLarsson
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Hanna S?derbergLarsson
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic