I am trying to figure out why I get a compile error on the code below:
package com....;
public enum Something { //says error: <identifier> expected on this line
private String myInput;
public Something(String paramString) {
    this.myInput = paramString;
}
public String getInputName() {
    return this.myInput;
}
}
                You have couple of problem with your enum declaration , first enum constructor cannot be public and second you need to add ; before private field. E.g.
public enum Something {
    ;
    private String myInput;
    Something(String paramString) {
        this.myInput = paramString;
    }
    public String getInputName() {
        return this.myInput;
    }
}
                        Since it seems you are not using enumerations, change "enum" to "class".
package com....;
public class Something {
    private String myInput;
    public Something(String paramString) {
        this.myInput = paramString;
    }
    public String getInputName() {
        return this.myInput;
    }
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With