i've added code tags to make your post easier to read. next time, just highlight your java and click the little "code" button above, just like you wanted to make it bold or italic.
I didn't really look at this code to see if it works or not. My GUESS is that the code is probably fine, but that you are not putting it in the correct spot. You need to be sure it is not inside another method, but that it is inside the class itself. Proper formatting makes it easier to tell. But basically, your code should be structured something like
public class MyClass
if you can't figure it out, paste all your source here, as the problem is probably not in this sample
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Sep 26, 2011
Thanks for the reply, seems I was nearly doing the right thing. I'm not getting any compile errors now however I'm not getting
anything printed out when I run the program. I'll soldier on with that as It must be something fairly straightforward I'm doing wrong.