Skip to content

Instantly share code, notes, and snippets.

@fermopili
Created March 19, 2017 12:31
Show Gist options
  • Save fermopili/18532facdf68b5415065e895d75e7b83 to your computer and use it in GitHub Desktop.
Save fermopili/18532facdf68b5415065e895d75e7b83 to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1325
/*
1. Исправь классы Fox и BigFox так, чтобы программа компилировалась.
Задача не предполагает создания экземпляров базового класса.
2. Метод main менять нельзя.
*/
public class Solution {
public static void main(String[] args) throws Exception {
Fox bigFox = new BigFox();
System.out.println(bigFox.getName());
System.out.println(bigFox.getColor());
}
public interface Animal {
Color getColor();
}
public static abstract class Fox implements Animal {
public String getName() {
return "Fox";
}
}
public static class BigFox extends Fox{
public Color getColor(){return Color.CYAN;};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment