You cannot define enumerations in methods, but you can define classes, so if you really want to create your method this way, you can define an array of your local class object.
public void doSomething() { class Country { int population = 0; String name = null; public Country(int population, String name) { this.population = population; this.name = name; } } Country[] countries = { new Country(85029304, "Germany"), new Country(61492053, "Spain") };
source share