Page 1 of 1

When must I use throws ISOException at the end of the declaration line?

Posted: Sat Dec 19, 2015 1:50 am
by marclo
This is a process method declaration followed by throws ISOException.

Code: Select all

public void process(APDU apdu) throws ISOException 
    {
    ...
    } 

Another process declaration line from the end of which I removed throws ISOException.

Code: Select all

public void process(APDU apdu)
    {
    ...
    }


What is the difference between the two expression below? When must I use throws ISOException at the end of the declaration line?

Re: When must I use throws ISOException at the end of the declaration line?

Posted: Sat Dec 19, 2015 4:17 am
by UNKNwYSHSA
Please read this article first.
https://docs.oracle.com/javase/tutorial ... aring.html

And the ISOException
is an unchecked exception. including it in the throws clause is not mandatory.


ISOException is a RuntimeException:

Code: Select all

public class ISOException extends CardRuntimeException {
public class CardRuntimeException extends RuntimeException {