This content has been marked as final. Show 3 replies
Declare the variable but don't initialize it. Then construct the RAF inside of a try/catch in a static block.
Honestly though, this seems a little weird.
Thank you. That solved the problem. Took me a min to figure out the static block, but I did. Thanks for your help.
Edited by: DarkFerret on Feb 12, 2008 3:32 PM
DarkFerret wrote:This is a big mistake. Make that bank an instance variable. You can give a variable class scope WITHOUT it being static. You should do that.
Hello. I am working on a project, and I am having some trouble with my code.
My main question is is it possible to create and use a Random Access File as part of a class, but outside of any of the classes methods? I have written my code that way, but when I compile, I get an error about the syntax. Below is the code and error message:
Error Message (using gcj on Ubuntu Linux to compile):This is another mistake. Get rid of gcj it is terrible garbage. Replace it with the Sun JDK, there is one for ubuntu so you won't have much trouble doing this.
If you stick with gcj I assure you you will run into to all sorts of unpleasant runtime errors that you will find difficult to diagnose and fix because gcj is non-compliant, bug ridden trash.