error traping
Author |
Message |
magicman
|
Posted: Tue Oct 05, 2004 8:29 am Post subject: error traping |
|
|
i need to now how to make error trapping |
|
|
|
|
|
Sponsor Sponsor
|
|
|
wtd
|
Posted: Tue Oct 05, 2004 10:19 am Post subject: (No subject) |
|
|
What kind of "error" do you need to "trap"?
In Java, errors are generally indicated by "exceptions". When the program runs into something wrong, it throws an exception. You can then handle that exception, including a specific chunk of code to run if the exception occurs.
A tutorial on exception handling is provided here.
http://www.compsci.ca/v2/viewtopic.php?t=1534 |
|
|
|
|
|
magicman
|
Posted: Wed Oct 06, 2004 7:47 am Post subject: (No subject) |
|
|
well i need error trapping for some thing like this
------------
if (weapon.equals ("simple weapons"))
{
c.println ("Pick the type of weapon");
c.println ("gauntlet");
c.println ("dagger");
c.println ("morningstar");
c.println ("longspear");
c.println ("crossbow");
}
--------------
like if they spell it worng or capalise is or some thing like that... |
|
|
|
|
|
Andy
|
Posted: Wed Oct 06, 2004 3:54 pm Post subject: (No subject) |
|
|
read wtd's post.. has everything u need |
|
|
|
|
|
|
|