Click here to watch in Youtube :
https://www.youtube.com/watch?v=1f_xnkZQ7m4&list=UUhwKlOVR041tngjerWxVccw
enum Operation { PLUS, MINUS, MULTIPLY, DIVIDE; } public class EnumDemo { public static void main(String[] args) { Operation[] operationArray = Operation.values(); /* * To loop a Enum object. */ for (Operation operation : operationArray) { System.out.println(operation); } } }Output
PLUS MINUS MULTIPLY DIVIDEClick the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/EnumDemo_Operation_all_Values_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/EnumDemo_Operation_all_Values_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/45d5519a1474198166ac515ccd559cc996bb550c/BasicJava/EnumDemo_Operation_all_Values_App/?at=master
See also:
No comments:
Post a Comment