Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30700

Re: checked exception thrown from an initializer ok?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: checked exception thrown from an initializer ok?
Date 2015-01-13 18:06 -0500
Organization A noiseless patient Spider
Message-ID <m948cf$3vk$1@dont-email.me> (permalink)
References <slrnmbb7o5.uoi.avl@login.logic.tuwien.ac.at>

Show all headers | View raw


On 1/13/2015 5:40 PM, Andreas Leitgeb wrote:
> I just stumbled into a surprise and I can't tell yet, whether
> to be relieved or worried...
>
> To avoid some unneccessary verbosity lateron, I defined in a
> central class:
>    public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
>
> What surprises me is, that eclipse accepts it without barfing
> about the unhandled exception.  [...]

     It's not necessary to handle unchecked exceptions.  If they
occur, of course, they'll be thrown and you can (if you like)
catch them.  But the compiler doesn't insist that you do so.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

checked exception thrown from an initializer ok? Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-01-13 22:40 +0000
  Re: checked exception thrown from an initializer ok? Steven Simpson <ss@domain.invalid> - 2015-01-13 22:52 +0000
  Re: checked exception thrown from an initializer ok? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-01-13 18:06 -0500
  Re: checked exception thrown from an initializer ok? Dmitry Davletbaev <ddomgn@gmail.com> - 2015-01-14 01:17 -0800
    Re: checked exception thrown from an initializer ok? Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-01-14 11:11 +0000

csiph-web