Question: I need help wioth my code please public interface Measurable { double getMeasure ( ) ; } public class Country implements Measurable { private String
I need help wioth my code please
public interface Measurable
double getMeasure;
public class Country implements Measurable
private String name;
private double area;
public CountryString name, double area
this.name name;
this.area area;
public String getName
return name;
public double getArea
return area;
@Override
public double getMeasure
return getArea;
public class Util
public static double averageMeasurable objects
double sum ;
for Measurable obj : objects
sum obj.getMeasure;
return objects.length sum objects.length : ;
public class AverageArrayTester
public static void mainString args
Measurable countries new Measurable
new CountryCountry A
new CountryCountry B
new CountryCountry C
;
double averageArea Util.averagecountries;
System.out.printlnThe average area is: averageArea;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
