Created
March 19, 2017 12:22
-
-
Save fermopili/1fc60d6b9013a80cd16df12224d95728 to your computer and use it in GitHub Desktop.
com.javarush.task.task13.task1311
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) throws Exception | |
{ | |
EnglishTranslator englishTranslator = new EnglishTranslator(); | |
System.out.println(englishTranslator.translate()); | |
} | |
public static abstract class Translator | |
{ | |
public abstract String getLanguage(); | |
public String translate() | |
{ | |
return "Я переводчик с " + getLanguage(); | |
} | |
} | |
public static class EnglishTranslator extends Translator | |
{ | |
public String getLanguage() | |
{ | |
return "английского"; | |
} | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment