Computer Science Canada Instantiating an interface |
Author: | np_123 [ Mon Jan 18, 2016 11:02 pm ] | ||
Post subject: | Instantiating an interface | ||
So I know some stuff about coding in Java, and the basics of how encapsulation and other OOP concepts work, but this code excerpt(not my own) kinda surprised me... You can't instantiate abstract classes and you can't instantiate regular interfaces so what's so special about a nested/inner interface that allows this code to run? Also, when and why would you instantiate an interface?
|
Author: | Insectoid [ Tue Jan 19, 2016 6:30 pm ] |
Post subject: | RE:Instantiating an interface |
looks like this has been answered here. |
Author: | np_123 [ Tue Jan 19, 2016 6:49 pm ] |
Post subject: | RE:Instantiating an interface |
hmm, yeah that's interesting. haven't really come across that type of usage before |