must be caught or declared to be thrown...

how would i go about something like that?_import java.util.*;public class GameLauncher{public static void main( String [] args) {SellGame game = new SellGame(); game.startGame(); }}__
[253 byte] By [thatonejewishguy] at [2007-9-30 22:29:10]
# 1
Something like what?And what's the meaning of your subject line? Is that an error message you're getting?
paulcw at 2007-7-7 12:52:28 > top of Java-index,Archived Forums,Debugging Tools and Techniques...
# 2

> how would i go about something like that?

I am guessing that your program will not compile... something like this:

% cat HelloWorld.java

public class HelloWorld {

public static void main(String args[]) {

System.out.println("Hello, world!");

java.lang.Thread.sleep(500);

}

}

% javac -g HelloWorld.java

HelloWorld.java:5: unreported exception java.lang.InterruptedException; must be caught or declared to be thrown

java.lang.Thread.sleep(500);

^

1 error

Refer to this section of the Tutorial for an explanation:

Exception Handling Statements

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/exception.html

Hope this helps.

"Troubleshooting Guide for J2SE 5.0",

http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

timbell at 2007-7-7 12:52:28 > top of Java-index,Archived Forums,Debugging Tools and Techniques...
# 3
A follow-up to my own post (sorry). Here is an even better section of the Tutorial:Lesson: Handling Errors with Exceptions http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
timbell at 2007-7-7 12:52:28 > top of Java-index,Archived Forums,Debugging Tools and Techniques...