Example
public enum STUFF
{
THING("Ok"), STUFF("Sweet"), PEOPLE("umm"), CAR("Vrrm");
String contents;
STUFF(String x)
{
contents = x;
}
public String getContents()
{
return ??
}
}
Desired result:
System.out.print(STUFF.CAR.getContents());
//Vrrm
The assignment in the constructor is wrong.
should be: –
And the return value in
getContents()should be: –