Sunday, February 25, 2018

Java program : Enumerator declared outside a class

//Enum declaration outside class



        enum Heroin {katrina,hema,madhuri,alka,sharmila,kareena,};
       
class EnumOutsideClass
{       
        public static void main(String[] args)
        {
        for(Heroin h:Heroin.values())
        {
                System.out.println(h);
        }
}        }

Thanks
Happy programming!

No comments:

Post a Comment

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows