i just got out of a lecture involving exceptions and my head is still spinning. Could someone please give me a brief explanation to what exceptions are and when they are used. thanks!
glaserc
Exceptions are a way to handle possible errors and the syntax is
try
{
// put whatever you want to happen. eg: A user has to enter some numbers in a text field and you only want numbers.
}
catch(Exception e)
{
//put an error message or whatever you want. For instance, if a user does not enter a message or enter some characters, display a message saying that he has to enter something in a text field or that he can only put numbers!!
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.