<<< unchecked exception example | Index | throw testing >>> |
import java.util.*;
public class RethrowExceptionExamp1e
{
static Scanner console = new Scanner( System.in );
public static void main( String[] args )
{
int number;
try
{
number = getNumber();
}
catch ( InputMismatchException ex )
{
System.out.println( "Exception " + ex.toString() );
throw ex; //rethrow
}
}
}//class RethrowExceptionExamp1e
<<< unchecked exception example | Index | throw testing >>> |