I created a class enum
of java
public enum Cor {
AZUL(1),VERMELHO(2),VERDE(3);
private int var;
Cor(int var)
{
this.var = var;
}
}
In main
I will create a menu using do/while
and switch/case
and will be shown the colors, how to pick the chosen color and pass in the parameter of a method?
In the menu it goes like this
System.err.println("Escolha uma cor");
System.err.println("1-Azul");
System.err.println("2-Vermelho");
System.err.println("3-Verde");
When typing 1, you should get the color Blue.