Online Java Compiler By
JavaTpoint.com
enum Flower{ Rose,Lily, Orchids, Sunflower,Jasmine; } public class Enum_valueOfMethodExample2 { public static void main(String[] args) { System.out.println("The part which is exposed to the environment is :"); for(Flower flower : Flower.values()) { System.out.println(Flower.valueOf(" ")); } } }
Output