Java IO Tutorial - Java

Syntax has the following syntax.

public final String name()


In the following code shows how to use method.

import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Map;
/*from  w w  w .ja  v a2s  .  c o m*/
public class Main {

  public static void main(String[] args) {
    Map<String, Charset> charsets = Charset.availableCharsets();
    Iterator<Charset> iterator = charsets.values().iterator();
    while (iterator.hasNext()) {
      Charset cs = (Charset);

The code above generates the following result.