DanjahSoft Programmer
DanjahSoft Programmer

Reputation: 95

Error trying to Create Enum

With the following code:

package com.Flaiva.NEWMETHODS;
import java.lang.Enum;


public class Imgreel {

//right here//

    public Enum Mobtype{

    }

//End//

public void select(){

    }
}

I of course, tried to initialize an Enum as directly indicated by oracle java tutorials.Unfortunately its not working so could someone please clarify this for me...... before i die of insanity.

Upvotes: 0

Views: 68

Answers (2)

SpringLearner
SpringLearner

Reputation: 13844

enum is keyword and every keyword in java starts with lower case

change your code to

package com.Flaiva.NEWMETHODS;
import java.lang.Enum;


public class Imgreel {


    public enum Mobtype{

    }


public void select(){

    }
}

Upvotes: 1

Walshy
Walshy

Reputation: 850

No need to import Enum

Also change Enum to enum in the public Enum Mobtype
Change it to, public enum Mobtype {

Upvotes: 0

Related Questions