TurkuBasicOOPinJava / Week 6: Methods of OO Programming /03B. Nordic countries as class variables
KaiquanMah's picture
public static String FINLAND = "FI";
a3fe381 verified
In the class NordicCountries,
define a class variable for each Nordic country (Finland, Sweden, Norway, Denmark and Iceland).
The variables will be assigned the abbreviation of the country (FI, SE, NO, DE and IS).
Remember to use the correct spelling for the category variable names!import java.util.Random;
public class Test{
public static void main(String[] args){
final Random r = new Random();
}
}
class NordicCountries {
//ADD
public static String FINLAND = "FI";
public static String SWEDEN = "SE";
public static String NORWAY = "NO";
public static String DENMARK = "DE";
public static String ICELAND = "IS";
}
Finland: FI
Sweden: SE
Norway: NO
Denmark: DE
Iceland: IS