I'm a beginner when it comes to programming Java code. I'm having a real tough time on how this class is wrong such as when I'm trying to extend the class. public final class SeatType extends Enum
This is my whole class:
package assignment;
public final class SeatType extends Enum
{
public static final SeatType AISLE;
public static final SeatType WINDOW;
public static final SeatType MIDDLE;
private static final SeatType $VALUES[];
public static SeatType[] values()
{
return (SeatType[])$VALUES.clone();
}
public static SeatType valueOf(String name)
{
return (SeatType)Enum.valueOf(assignment/SeatType, name);
}
private SeatType(String s, int i)
{
super(s, i);
}
static
{
AISLE = new SeatType("AISLE", 0);
WINDOW = new SeatType("WINDOW", 1);
MIDDLE = new SeatType("MIDDLE", 2);
$VALUES = (new SeatType[] {
AISLE, WINDOW, MIDDLE
});
}
}
EDIT:
These are the errors.
SeatType cannot be resolved to a variable. assignment cannot be resolved to a variable. The type SeatType may not subclass Enum explicitly. The constructor Object(String, int) is undefined –
Any help is much appreciated :)