Created
May 11, 2017 05:23
-
-
Save leogtzr/7b18e9c51fba5a230ab565d4d077d087 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
interface TV { | |
void show(); | |
} | |
enum TVFactory { | |
COLOR { | |
@Override | |
TV create() { | |
return () -> { | |
System.out.println("Showing content in Color ... "); | |
}; | |
} | |
}, | |
LED { | |
@Override | |
TV create() { | |
return () -> { | |
System.out.println("Showing content using LED ... "); | |
}; | |
} | |
}, | |
// etc ... | |
; | |
abstract TV create(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment