Computer Science Canada the exit phrase |
| Author: | Chinmay [ Mon Jan 07, 2008 6:37 pm ] | ||
| Post subject: | the exit phrase | ||
Ok I have a if block inside a try block as such:
why would this gimme an syntax error and not exit the if and after ending the try block? |
|||
| Author: | HeavenAgain [ Mon Jan 07, 2008 6:45 pm ] | ||
| Post subject: | RE:the exit phrase | ||
simple, its because thats not how you use try. look at the exception tut for detail about try & catch. int your case, you do not need try at all, so your code will simply be
if you MUST use exit, the syntax is System.exit(int status), unless you import static System class, you cannot just say exit, and static import is only supported in java1.6 i believe |
|||