This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Java in General and the fly likes getClass().getResource() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "getClass().getResource()" Watch "getClass().getResource()" New topic


Dhana Muthu

Joined: Nov 15, 2003
Posts: 2
I would like to use the getClass().getResource() inside a static method, which is basically a utility method.. But i'm getting non-static referece compilation error..
Any fixes ??
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi Dhana
Try this,

Dhana Muthu

Joined: Nov 15, 2003
Posts: 2
Yeah... i tried same kind of code and it worked...
Thanks .....
I agree. Here's the link:
subject: getClass().getResource()
It's not a secret anymore!