Enquiries for Enum in java
How can I declare enum inside the class? Like how can I modify to make sure my code runs? Take note(Enum must be inside the class) class Sportperson { enum Country{ Usa, Brazil, Indonesia}; private Country home; private String player_name; public Sportperson (Country home, String player_name ) { this.home=home; this.player_name = player_name ; } public void printDetails() { System.out.printf("The player's country is %s",home); System.out.printf("name: %s",player_name ); } } public class Program { public static void main(String[] args) { Sportperson mvp = new Sportperson (Country.Usa, "Mike"); mvp.printDetails (); } }