We help IT Professionals succeed at work.
Get Started

abstract method in enum

gudii9 asked
Last Modified: 2014-08-10

I was reading below link


and the example
public enum Currency implements Runnable{
          PENNY(1) {
                  public String color() {
                          return "copper";
          }, NICKLE(5) {
                  public String color() {
                          return "bronze";
          }, DIME(10) {
                  public String color() {
                          return "silver";
          }, QUARTER(25) {
                  public String color() {
                          return "silver";
          private int value;

          public abstract String color();
          private Currency(int value) {
                  this.value = value;


Open in new window

I wonder why we need abstract kind of methods inside enums. what are the practical use of it. what design pattern is being used.Please advise
Watch Question
This problem has been solved!
Unlock 2 Answers and 17 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE