Re: Inconsistent behaviour

From: Madhur Ahuja (ef_at_df.com)
Date: 10/03/04


Date: Mon, 4 Oct 2004 03:27:18 +0530

Razvan <mihai11@mailcity.com> wrote:
> Hi !
[snip]
> The second version does not compile ! Compiler error:
>
> SimpleJava.java:19: exception java.io.IOException is never thrown in
> body of corresponding try statement
> catch(IOException ee) {
>
>
> Compiler error or expected behavior ?

This is taken from one of the earlier post:

To be able to catch a checked exception a method inside the try block
must declare that it throws that exception (or one derived from it).

> Regards,
> Razvan

--
Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com]
Homepage
http://madhur.netfirms.com


Relevant Pages

  • Re: buildworld failures on STABLE
    ... compiler error: Segmentation fault: 11 ... The compiler dying with signal 11 is a typical memory problem. ... kernel places strict limit to amount of memory that user-level application ...
    (freebsd-stable)
  • Re: Whats wrong with Private keyword
    ... the solution with some meaningful correction ... note that if you look at the compiler error carefully, ... it uses "jargon" - but jargon you should make yourself familiar ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Compiler error or my mistake
    ... does not give an error if str is null. ... Is this a compiler error? ... the execution. ...
    (comp.lang.c)
  • Re: Newbie needing some help with segmentation fault
    ... Hendrik Maryns wrote: ... snip ... ... I get the following compiler error here: ... All perfectly standard. ...
    (comp.lang.c)