The Artima Developer Community
Sponsored Link

Java Answers Forum
Error handling

2 replies on 1 page. Most recent reply: Apr 17, 2003 3:08 AM by Adam Duffy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
jake

Posts: 83
Nickname: onorok
Registered: May, 2002

Error handling Posted: Apr 16, 2003 7:39 PM
Reply to this message Reply
Advertisement
Ok, so I am implementing the Collection Interface and with every function I have to implement there are some errors that I could throw. But....I don't know how to do this, can someone please explain what I should do.
thanks,
jake.


Alex S

Posts: 27
Nickname: andu
Registered: Mar, 2003

Re: Error handling Posted: Apr 17, 2003 1:44 AM
Reply to this message Reply
Just say:

public void myMethod() throws MyException {
throw new MyException();
}

Try to study the j2sdk class sources if you want examples from Collection implementation.

And read the Error Handling topic from java tutorial.

Adam Duffy

Posts: 168
Nickname: adamduffy
Registered: Feb, 2003

Re: Error handling Posted: Apr 17, 2003 3:08 AM
Reply to this message Reply
The article that Alex is referring to can be found at http://java.sun.com/docs/books/tutorial/essential/exceptions/

Adam

Flat View: This topic has 2 replies on 1 page
Topic: MS J++ Help Previous Topic   Next Topic Topic: Forms: How to pass them and use them after they are passed.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use