Here's what I have so far.....a few errors that i cant figure out. I'm still really green, so sorry everyone....
//country file
public class Country { // fields private String name; private int population; private int area; // in square miles // constructors // methods public String getName() { return name; } public int getPopulation() { return population; } public int getArea() { return area; } public void setName(String newName) { name = newName; } public void setPopulation(int newPopulation) { population = newPopulation; } public void setArea(int newArea) { area = newArea; } // population per square mile public int populationDensity() { int density; density = population / area; return density; } } //countryApp file public class CountryApp System.out.println("Testing class Country"); Country Country1 = new Country(); System.out.println(); Country1.setName("Macau"); Country1.setPopulation(453000 %,d); //I would like my output to have the commas in the right locations in this int// Country1.setArea(6); System.out.printf("Name: %s%n", Country1.getName()); System.out.printf("Population: %,d%n", Country1.getPopulation()); System.out.printf("Area: %d%n", Country1.getArea()); System.out.printf("Population Density: %,d", populationDensity(density)); //What am i doing wrong here to get my output to read population density, with commas?//
}
}