• 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

Exceptional exception

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello java PPL
Please go through the code carefully
Assume it to be in some method
try
{
}
catch(java.io.IOException t) //line 1
{
System.out.println("Inside Catch");
}

When method is called:
Compiler error complaining about the catch block where no IOException object can ever be thrown
on the other hand if I use catch (Exception s){} at line 1 argument it compiles alright why???
Regards Denish
 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Denish,
C the following thread:
http://www.javaranch.com/ubb/Forum24/HTML/009435.html
 
denish mehta
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Sorry buddy Ratul failed to see relevance. If u mean to say it was run time exception then i would say think again .Other wise be kind enough to eloborate the point.
Thank u
Denish
reply
    Bookmark Topic Watch Topic
  • New Topic