Skip to content

Instantly share code, notes, and snippets.

@fermopili
Created March 19, 2017 12:26
Show Gist options
  • Save fermopili/5a7a213da3727825eeee09aa642b448d to your computer and use it in GitHub Desktop.
Save fermopili/5a7a213da3727825eeee09aa642b448d to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1317
/*
Погода
*/
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;}
}
}
public interface Weather {
String getWeatherType();
}
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