Download Jar. Libraryless. Click here for Pure Java version (6065L/43K).
1 | !7 |
2 | |
3 | sinterface Bla {
|
4 | default S bla() { ret "ok"; }
|
5 | } |
6 | |
7 | sclass Blubb implements Bla {
|
8 | } |
9 | |
10 | sclass Overridden implements Bla {
|
11 | public S bla() { ret "different!"; }
|
12 | } |
13 | |
14 | sclass OverriddenSubclass extends Overridden {}
|
15 | |
16 | p-exp {
|
17 | assertEqualsVerbose("ok", call(new Blubb, "bla"));
|
18 | assertEqualsVerbose("different!", call(new Overridden, "bla"));
|
19 | assertEqualsVerbose("different!", call(new OverriddenSubclass, "bla"));
|
20 | } |
Began life as a copy of #1022197
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1022199 |
| Snippet name: | Call default method by reflection Spike, now works in default lib [OK] |
| Eternal ID of this version: | #1022199/1 |
| Text MD5: | e092494c9dd352621cd4a20bb7dd9ffd |
| Transpilation MD5: | 6f2dd56bcaa9fab61afd6c79b6f4cc79 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-03-11 10:24:36 |
| Source code size: | 436 bytes / 20 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 595 / 1472 |
| Referenced in: | [show references] |