Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 error traping
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
magicman




PostPosted: Tue Oct 05, 2004 8:29 am   Post subject: error traping

i need to now how to make error trapping
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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




PostPosted: Wed Oct 06, 2004 3:54 pm   Post subject: (No subject)

read wtd's post.. has everything u need
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: