Category: Java

Practice Problems on enum – Set2

Will the below code of enum compile?? MONTHS.java package com.masterjavatutorial; public enum MONTHS { public void methodOne(){ System.out.println(“Method One”); } } Semicolon is mandatory if any method is declared in… Read more »

Enum valueOf() Method

valueOf() is a static method of java.lang.Enum which takes argument as String. valueOf() method returns the enum constant for the specified string value which is passed as an argument in… Read more »