Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 9th, 2001, 09:35 AM
daisydook daisydook is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 3 daisydook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hiya everybody,

I don't have much experience in java and am about to write a class which uses a lot of library classes. How do I know what exceptions the class will throw? Also does anyone know any definitive websites that will help me understand all the possible exceptions that can be thrown by java methods? (Please don't just point me to URL

Thanks,

daisy

Reply With Quote
  #2  
Old February 13th, 2001, 09:23 PM
waldthau waldthau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Colorado
Posts: 46 waldthau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Post

There's not a real simple way to find out what exceptions will be thrown, but here are two options:

- You could write your code w/o any try/catch blocks and try to compile your program. This isn't to efficient, but the compiler will tell you what exceptions need to be caught.

- A better way is to visit the API documentation which is on Sun's site. The API for the 1.2.2 JDK can be found at http://java.sun.com/products/jdk/1..../api/index.html (If you go to http://java.sun.com/docs/index.html you can find links for the API documentation of other JDKs as well.)I know you didn't want to be pointed to java.sun.com, but the API documentation will show you the exceptions that can be thrown for each method in each class. (Although some methods do not throw any exceptions.)

I hope that helps you out, even though I mentioned java.sun.com. 8^)
__________________
- MW

Reply With Quote
  #3  
Old February 14th, 2001, 04:16 AM
daisydook daisydook is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 3 daisydook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks waldthau

That is just what I needed :-)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > How do I know what Exception will be thrown?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway