Java Format - Java Formatter.ioException()


Formatter.ioException() has the following syntax.

public IOException ioException()


In the following code shows how to use Formatter.ioException() method.

//from   www .  j  a va2 s .c  om

import java.util.Formatter;
import java.util.Locale;

public class Main {

   public static void main(String[] args) {

      StringBuffer buffer = new StringBuffer();
      Formatter formatter = new Formatter(buffer, Locale.US);

      String name = "from";
      formatter.format("Hello %s !", name);


The code above generates the following result.