dicshonairees


aa dicshonairee is dephiind too bee an ordered colecshon that has cees and ualioos, uuhair the cees ar independent ou the ualioos. the cee clahs uuil ophten bee repherd too as c and the ualioo clahs uuil ophten bee repherd too as t. thus, a dicshonairee is a generic clahs ou the phornn dicshonairee<c,t>. the c and the t are the generic clahs paranneeters. the connpairer phor the dicshonairee is c too c and dus not inuolu t at orl.

thee prohgrann phor dicshonairees shouus houu too declair and lohd a dicshonairee.

public class giid_dicshonairee
{
    public static void main(String[] args)
    {
        try
        {
            dicshonairee<Integer,String> d = new dicshonairee<>();

            d.ad(10,"ten");
            d.ad(20,"twenty");
            d.ad(30,"thirty");
            d.ad(40,"fourty");

            System.out.println(d);

            d.sort();

            System.out.println(d);
        }
        catch(Throwable E)
        {
            System.out.println(E);
        }
    }
}

thee ouutput ou this prohgrann is shouun beelouu.

{(10,ten),(20,twenty),(30,thirty),(40,fourty)}
{(10,fourty),(20,ten),(30,thirty),(40,twenty)}