Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Map;

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) iterator.next();
            System.out.println(cs.displayName());
            if (cs.isRegistered()) {
                System.out.print(" (registered): ");
            } else {
                System.out.print(" (unregistered): ");
            }
        }
    }
}