I'm trying to create an object with enum. I have to create ice creams in a class IceCream where the flavors are chocolate and vanilla, strawberry. As I have to create many of them with different flavors (among other things), I thought in these (as I've saw):
enum Flavors { Chocolate = 1, Vanilla = 2, Strawberry = 3};
class IceCream{
public int type; //if it has two o more flavors
public Flavors flavor;
public IceCream(int type, Flavors flavor){
this.type = type;
this.Flavors = flavor;
}
}
Then, I want to show in console what flavor is my ice cream. How I can create an object and show in console what flavor is?
Thanks