Created
March 19, 2017 12:26
-
-
Save fermopili/5a7a213da3727825eeee09aa642b448d to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1317
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Погода | |
*/ | |
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 toString() { | |
return String.format("%s for today", this.getWeatherType()); | |
} | |
public String getWeatherType(){return this.type;} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Weather { | |
String getWeatherType(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface WeatherType { | |
String CLOUDY = "Cloudy"; | |
String FOGGY = "Foggy"; | |
String FROZEN = "Frozen"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment