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 elements in the hashtable
        d.put("1", "from java2s.com");
        d.put("2", "Cocoa");
        d.put("5", "Coffee");

        // return true if this dictionary maps no keys to value.
        boolean b = d.isEmpty();
        System.out.println("Dictionary is empty:" + b);
    }
}