How to convert Enum to String with Example

we can convert Enum to String by using toString Method..

For example

enum EnumToString{
public class EnumToStringMain{
public static void main(String args[]){
System.out.println(EnumToString.a.toString); //Here we convert enum value into String

Output is:

People who read this post also read :


Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
Kindly keep blogging. If anyone wants to become a Java developer learn from Java EE Online Training from India.
or learn thru Java EE Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

Post a Comment


Twitter Delicious Facebook Digg Stumbleupon Favorites More