Plusieurs manieres
try
{
...
} catch ( Exception ex )
{
// si ViewerException ici aussi ...
}
try
{
...
} catch ( ViewerException ve )
{
// si et seulement si ViewerException ..
}
try
{
...
} catch ( ViewerException ve )
{
// si et seulement si ViewerException ..
} catch ( Exception ex )
{
// si les autres
}
|---------+---------------------------->
| | "David MARQUES" |
| | <[EMAIL PROTECTED]|
| | eria.com> |
| | |
| | 18/06/2003 10:05 |
| | Please respond to|
| | java |
| | |
|---------+---------------------------->
>-------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc: (bcc: Dominique Gallot/BRU/MASTERCARD)
|
| Subject: Re: interface, impl �mentation et exception
|
>-------------------------------------------------------------------------------------------------------------------------------|
cette RuntimeException est-elle catchable ? si oui comment ? car
d'apr�s la javadoc �a n'a pas l'air d'�tre le cas.
----- Original Message -----
From: "Dominique Gallot" <[EMAIL PROTECTED]>
Date: Wednesday, June 18, 2003 9:46 am
Subject: Re: interface, impl �mentation et exception
>
> Ta class ViewerException doit �tendre RuntimeException
>
> Voila,
>
> Dominqiue
>
>
>
> |---------+---------------------------->
> | | "David MARQUES" |
> | | <[EMAIL PROTECTED]|
> | | eria.com> |
> | | |
> | | 17/06/2003 17:54 |
> | | Please respond to|
> | | java |
> | | |
> |---------+---------------------------->
> >----------------------------------------------------------------
> ---------------------------------------------------------------|
> |
> |
> | To: [EMAIL PROTECTED]
> |
> | cc: (bcc: Dominique Gallot/BRU/MASTERCARD)
> |
> | Subject: interface, impl �mentation et exception
> |
> >----------------------------------------------------------------
> ---------------------------------------------------------------|
>
>
>
>
> bonjour,
> j'ai un un objet qui impl�mente l'interface HyperlinkListener.
> j'impl�mente l'unique m�thode de cette interface dont la signature est
> la suivante :
> public void hyperlinkUpdate(HyperlinkEvent e)
> mon probl�me est que mon impl�mentation lance une exception maison
> (ViewerException).
> mais �tant donn� que la m�thode de l'interface ne lance aucune
> Exception , je ne peux ajouter un "throws ViewerException" � la
> signature de mon impl�mentation de cette m�thode.
> y-a-t il un moyen de contourner ? car je dois imp�rativement laisser
> remonter cette exception.
> merci par avance de votre �clairage.
>
>
>
>
>
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> This footnote also confirms that this email message has been swept by
> MIMEsweeper for the presence of computer viruses.
>
> www.mimesweeper.com
> **********************************************************************
>
>
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************