-1

I want to use Enum as a key value. I tired this:

public interface ElementTypeEnum
{
    public static String QUEUE_TRANSACTION = "queue_transaction";

    public static String QUEUE_API_ATTEMPT = "queue_api_attempt";
}

but when I tried to use it this way: QUEUE_TRANSACTIONs cannot be resolved or is not a field

What is the proper way to use it?

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808

1 Answers1

1

Enum and interface are two different concepts in general, so you need to read :

https://docs.oracle.com/javase/tutorial/java/concepts/interface.html

What are enums and why are they useful?

https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

What is the use of interface constants?

gargkshitiz
  • 2,130
  • 17
  • 19