package com.javarush.task.task13.task1317; //The night is far gone, and the day is near. Let's therefore throw off the works of darkness, //and let's put on the armor of light. (Romans 13:12) /* The weather is fine */ public class Solution { public static void main(String[] args) { System.out.println(new Today(WeatherType.CLOUDY)); System.out.println(new Today(WeatherType.FOGGY)); System.out.println(new Today(WeatherType.FROZEN)); } static class Today implements Weather{ private String type; Today(String type) { this.type = type; } @Override public String getWeatherType(){return type;} @Override public String toString() { return String.format("%s for today", this.getWeatherType()); } } } -------------------------------------------Weather.java----------------------------------------------------------------- package com.javarush.task.task13.task1317; public interface Weather extends WeatherType { String getWeatherType(); } ------------------------------------------------------------------------------------------------------------------------ -------------------------------------------WeatherType.java------------------------------------------------------------- package com.javarush.task.task13.task1317; public interface WeatherType { String CLOUDY = "Cloudy"; String FOGGY = "Foggy"; String FROZEN = "Frozen"; } ------------------------------------------------------------------------------------------------------------------------ /* The weather is fine 1. РклаÑÑе Today ÑеализоваÑÑ Ð¸Ð½ÑеÑÑÐµÐ¹Ñ Weather. 2. ÐодÑмай, как ÑвÑзан паÑамеÑÑ type Ñ Ð¼ÐµÑодом getWeatherType(). 3. ÐнÑеÑÑейÑÑ Weather и WeatherType Ñже ÑÐµÐ°Ð»Ð¸Ð·Ð¾Ð²Ð°Ð½Ñ Ð² оÑделÑнÑÑ ÑÐ°Ð¹Ð»Ð°Ñ . ТÑебованиÑ: 1.âÐнÑеÑÑÐµÐ¹Ñ Weather должен бÑÑÑ Ñеализован в клаÑÑе Today. 2.âРклаÑÑе Today должен бÑÑÑ Ñеализован меÑод getWeatherType обÑÑвленнÑй в инÑеÑÑейÑе Weather. 3.âТип возвÑаÑаемого знаÑÐµÐ½Ð¸Ñ Ð¼ÐµÑода getWeatherType должен бÑÑÑ String. 4.âÐеÑод getWeatherType должен возвÑаÑаÑÑ Ð·Ð½Ð°Ñение пеÑеменной type. package com.javarush.task.task13.task1317; /* The weather is fine */ public class Solution { public static void main(String[] args) { System.out.println(new Today(WeatherType.CLOUDY)); System.out.println(new Today(WeatherType.FOGGY)); System.out.println(new Today(WeatherType.FROZEN)); } static class Today { private String type; Today(String type) { this.type = type; } @Override public String toString() { return String.format("%s for today", this.getWeatherType()); } } } */