-
strange error message when compiling
getting a strange error message.
it's with my System.exit(0);
my program was working FINE and now it's giving me this error when i compile. and i really can't figure out what it is!!
BankingSystem.java:202: <identifier> expected
System.exit(0);
^
BankingSystem.java:204: 'class' or 'interface' expected
}
^
BankingSystem.java:205: 'class' or 'interface' expected
^
3 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
i have all the "}" that i need in there. hmmmm. i really don't know what it wants. that System.exit(0) is my last line of code . . . except for 2 more of "}".
thanks
crq
-
ok. i just got it.
nevermind.
charity
-
-
roflmao... well, charity does begin at home...
-
Originally posted by crq
it's with my System.exit(0);
just remember this:
jsut because that's what the compiler says is wrong, doesnt mean that it is actually what's wrong.. use the compiler errors as guidance.. if you put too many } in a certain place, the compiler wont tell you that there are too many }, merely that it happened upon something that it was not expecteing (i.e. too many } caused it to think that the end of the class had been reached.. it then found code outside, and tells you it wants to see the word "class" first..
in this case, it would be erroneous to obey the compiler.. instead you should correct the input that is causing it to come to the wrong conclusion..
which you no doubt did
-
try not to use System.exit(0)
if it is the last instruction you can remove it from
the program and nothing will happen
good luck
-
what else would you do to finish a program?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks