I want to convert this sample C# code into a java code:
public enum myEnum {
ONE = "one",
TWO = "two",
};
Because I want to change this constant class into enum
public final class TestConstants {
public static String ONE = "one";
public static String TWO= "two";
}
In short – you can define any number of parameters for the enum as long as you provide constructor arguments (and set the values to the respective fields)
As Scott noted – the official enum documentation gives you the answer. Always start from the official documentation of language features and constructs.
Update: For strings the only difference is that your constructor argument is
String, and you declare enums withTEST("test")