Implementation of abstract method definition for enumeration types
Package com. lc. day02.EnumTest; import org. junit. test; public class implements actenumtest {@ Testpublic void test () {print (Grade1. B);} public void print (Grade1 g) {String val = g. localValue (); System. out. println (val) ;}} enum Grade1 {// A, B, C, D, E; // The objects A ("100-90") {public String localValue () {return "" ;}} generated by the five non-parametric constructors of the class ";}}, B ("89-80") {public String localValue () {return "good" ;}}, C ("79-70") {public String localValue () {return "normal" ;}}, D ("69-60") {public String localValue () {return "poor" ;}}, E ("59-0 ") {public String localValue () {return "fail" ;}}; private String value; private Grade1 (String value) {// The enumeration Type constructor should be private this. value = value;} public String getValue () {return this. value;}/** abstract methods in enumeration must be defined when an object is created */public abstract String localValue ();}