generated from ohjelmointi2/gradle-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountryMain.java
More file actions
27 lines (22 loc) · 937 Bytes
/
CountryMain.java
File metadata and controls
27 lines (22 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package interfaces.country;
import java.util.Arrays;
import java.util.List;
/**
* You can use this main method to verify that your changes to the Country class
* work as expected. Actual automated testing is done using JUnit tests.
*/
public class CountryMain {
public static void main(String[] args) {
// https://en.wikipedia.org/wiki/Nordic_countries, 9.8.2023
Country den = new Country("Denmark", 5_894_687);
Country fin = new Country("Finland", 5_587_442);
Country ice = new Country("Iceland", 354_234);
Country nor = new Country("Norway", 5_509_591);
Country swe = new Country("Sweden", 10_261_767);
List<Country> countries = Arrays.asList(den, fin, ice, nor, swe);
countries.sort(null); // A null value indicates that the elements' natural ordering should be used
for (Country c : countries) {
System.out.println(c);
}
}
}