Country.java.html

  1  /**
  2     A country with a name and area.
  3  */
  4  public class Country implements Measurable
  5  {
  6     private String name;
  7     private double area;
  8  
  9     /**
 10        Constructs a country.
 11        @param aName the name of the country
 12        @param anArea the area of the country
 13     */
 14     public Country(String aName, double anArea) 
 15     { 
 16        name = aName;
 17        area = anArea; 
 18     }
 19  
 20     /**
 21        Gets the country name.
 22        @return the name
 23     */
 24     public String getName() 
 25     {
 26        return name;
 27     }
 28  
 29     /**
 30        Gets the area of the country.
 31        @return the area
 32     */
 33     public double getArea() 
 34     {
 35        return area;
 36     }
 37  
 38     public double getMeasure() 
 39     {
 40        return area;
 41     }
 42  }