Created
March 19, 2017 12:31
-
-
Save fermopili/18532facdf68b5415065e895d75e7b83 to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1325
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
/* | |
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