private static void printReport(Country[] country) {
System.out.printf("%-25s%-16s%-10s%-18s%-17s%-14s\n",
"Name", "Code", "Capitol", "Population", "GDP", "HappinessRank");
System.out.print("------------------------------------------------------------------------------------------------------");
System.out.println("");
for (Country b : country) {
System.out.printf("%-26s%-17s%-7s%10d%8s%-18s%7d\n",
b.getName(), b.getCode(), b.getCapitol(), b.getPopulation(), b.getGDP(), b.getHappinessRank());
}
}
Hey everyone! New to java programming,but I am stuck, I tried looking up how to fix it with no success.
What am I looking for? it keeps pointing at the b.getName(), b.getCode(), etc.
More of the code:
public static void main(String[] args) throws FileNotFoundException {
int maxCountries = 156;
Country[] countries = new Country[maxCountries];
String csvName = "Countries1.csv";
Scanner scanner = new Scanner(new File(csvName));
Scanner csvScan = scanner.useDelimiter("[,\n]"); {
System.out.println("Enter the File Name:"+csvName);
System.out.println("Amount of Countries Read:"+maxCountries);