Question: Consider the following Country class public class Country { String name; int population; double size; / / size in km ^ 2 public Country (

Consider the following Country class
public class Country{
String name;
int population;
double size; // size in km^2
public Country(String name, int pop, double size){
this.name = name;
this.population = pop;
this.size = size;
}
}
If we want this class to implement the Comparable interface so that we can compare Country objects, how should the first line be re-written?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!