Java Scanner ioException() Method

The ioException() is a method of Java Scanner class which is used to get the IOException last thrown by this Scanner's readable. It returns null if no such exception exists..

Syntax

Following is the declaration of ioException() method:

Parameter

This method does not accept any parameter.

Returns

The ioException() method returns the last exception thrown by this scanner's readable.

Exceptions

NA

Compatibility Version

Java 1.5 and above

Example 1

Output:

Hello World! Hello JavaTpoint.
Exception Output: null

Example 2

Output:

;Pawan;Suresh
Exception Output: null