I’m trying to set values to enum in my java application….but I can’t do that.
Am I doing it wrong???
public enum RPCPacketDataType {
PT_UNKNOWN(2),
PT_JSON(4),
PT_BINARY(5)
};
It’s giving me this error : The constructor RPCPacket.RPCPacketDataType(int) is undefined.
You can also define methods on your enum as you would in a “normal” class.