Created
December 27, 2017 16:00
-
-
Save kirich1409/539e7360c2be0b0a983b800e6efebecd to your computer and use it in GitHub Desktop.
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
abstract class Animal { | |
public void voice(){ | |
System.out.println("unknown"); | |
} | |
} | |
final class Cat { | |
public abstract void voice(){ | |
System.out.println("meow"); | |
} | |
} | |
public static void main(String[] args) { | |
Animal animal = new Cat(); | |
animal.voice() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment