java.lang.Enum.toString()


java.lang.Enum.toString()

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 of this enum constant

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

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

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

   }

}