Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Dictionary d = new Hashtable();

        // add some elements
        d.put("1", "from java2s.com");
        d.put("2", "Cocoa");
        d.put("5", "Coffee");

        // return an enumeration of the keys from this dictionary.
        for (Enumeration e = d.keys(); e.hasMoreElements();) {
            System.out.println(e.nextElement());
        }
    }
}