java.lang.Enum.hashCode()


java.lang.Enum.hashCode()

package com.codingdict;



import java.lang.*;



// enum showing programming languages

enum Language {

   C, Java, PHP;

}



public class EnumDemo {



   public static void main(String args[]) {



      // returns the name and hashCode of this enum constant

      System.out.print("Programming in " + Language.C.toString());      

      System.out.println(", Hashcode = " + Language.C.hashCode()); 

      System.out.print("Programming in " + Language.Java.toString());  

      System.out.println(", Hashcode = " + Language.Java.hashCode()); 

      System.out.print("Programming in " + Language.PHP.toString());  

      System.out.println(", Hashcode = " + Language.PHP.hashCode());    

   }

}