Answers for "enum with methods in java example"

9

enum java

public enum AlertLevel {
	Undefined(0),
	Ok(1),
	Warning(2),
	Alarm(3);
}
Posted by: Guest on June-21-2020
0

enum with methods in java example

public enum Level {
    HIGH{
        @Override
        public String asLowerCase() {
            return HIGH.toString().toLowerCase();
        }
    },
    MEDIUM{
        @Override
        public String asLowerCase() {
            return MEDIUM.toString().toLowerCase();
        }
    },
    LOW{
        @Override
        public String asLowerCase() {
            return LOW.toString().toLowerCase();
        }
    };

    public abstract String asLowerCase();
}
Posted by: Guest on December-24-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language