File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Exceptions... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Exceptions..." Watch "Exceptions..." New topic
Author

Exceptions...

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

The above code does not compile. It compiles fine if provided with throws MalformedURLException in the defnition of test().
My question it why is it asking for throws MalformedURLException in the method test() when it is already provided with IOexception(which is a superclass of MalformedURLException).
Thanx.
[added CODE tags for readability, and fixed overlong line - Jim]

[This message has been edited by Jim Yingst (edited February 07, 2000).]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
It compiles fine for me using jdk 1.2.2 or jdk 1.3 beta for Windows. What compiler are you using, and on what platform?
Your logic is correct - there should be no need for a throws MalformedURLException if there is already a throws IOException. I'd assume it's a bug in your compiler.


"I'm not back." - Bill Harding, Twister
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Jim:
I am using JDK 1.2 on windows 95.
Thanks for u'r reply.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exceptions...
 
Similar Threads
exception ?
Exceptions
Miscellaneous
Finally
try catch...........