• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exceptions...

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).]
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim:
I am using JDK 1.2 on windows 95.
Thanks for u'r reply.
 
reply
    Bookmark Topic Watch Topic
  • New Topic