| Author |
Anonymous inner class and Exception Handling
|
Marco Pacini
Greenhorn
Joined: Mar 16, 2010
Posts: 5
|
|
Hi all.
I'm studying inner class and i don't understand why it isn't possible throw an anonymous inner class like following exemple:
Regards
|
 |
Rob Spoor
Saloon Keeper
Joined: Oct 27, 2005
Posts: 18365
|
|
Does AnonymousInnerClass extend Throwable, Exception, RuntimeException or any other exception class? The following is perfectly legal:
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Marco Pacini
Greenhorn
Joined: Mar 16, 2010
Posts: 5
|
|
|
If i define the inner class when throw it, can i explain that it extend Throwable, Exception, RuntimeException or any other exception class?
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
Marco Pacini wrote:If i define the inner class when throw it, can i explain that it extend Throwable, Exception, RuntimeException or any other exception class?
Of course.
and this can be an inner class if you like.
|
 |
 |
|
|
subject: Anonymous inner class and Exception Handling
|
|
|