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, WeatherType {
private static String type;
Today(String type) {
this.type = type;
}
@Override
public String toString() {
return String.format("%s for today", this.getWeatherType());
}
public String getWeatherType() {
return type;
}
package com.javarush.task.task13.task1317;
/*
The weather is fine
*/
public class Solution {
public static void main(String[] args) throws Exception {
System.out.println(SimpleObject.NAME);
System.out.println(Button.NAME);
}
interface SimpleObject {
final String NAME = "SimpleObject";
void onPress();
}
interface Button extends SimpleObject {
// final String NAME = "Submit";
public void onPress();
String onPress(Object o);
}
class Today implements Weather,WeatherType {
private String type=CLOUDY;
public String getWeatherType() {
return type;
}
}
}