Last active
August 29, 2015 14:15
-
-
Save RuedigerMoeller/7f31f246b0adb5c80a00 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 ByteStream { .. } | |
class SomeClass { | |
void someMethod() { | |
this.getStream().writeByte(13); // call on interface or abstract class | |
} | |
ByteStream getStream() { .. } | |
} | |
// later in code | |
// does this avoid dynamic dispatch inside "SomeClass:someMethod" ? | |
SomeClass clsA = new SomeClass() { | |
ConcreteByteStream getStream() { .. } | |
}; | |
SomeClass clsB = new SomeClass() { | |
OtherConcreteByteStream getStream() { .. } | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:-) i will some day, thanks for your statement