fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. interface Foo {
  8. default void Meh() {
  9. System.out.println("Foo.Meh");
  10. }
  11. }
  12.  
  13. interface Bar {
  14. String test="t";
  15.  
  16. default String getTest(){
  17. return test;
  18. }
  19.  
  20. default void doTest(){
  21. System.out.println("Bar.doTest: -- getTest" + getTest());
  22. }
  23.  
  24. default void Bar() {
  25. System.out.println("Bar.Bar()");
  26. String blahh=test;
  27.  
  28. }
  29. static void Sup(){
  30. System.out.println("Bar.Sup -- Test: "+test);
  31. }
  32. default void Meh() {
  33. System.out.println("Bar.Meh -- Test: "+test);
  34. }
  35.  
  36. default void mega() {
  37. Meh();
  38. }
  39. }
  40.  
  41. abstract class Test {
  42. public void Meh() {
  43. System.out.println("Test.Meh");
  44. }
  45. }
  46.  
  47. class Ideone extends Test implements Foo, Bar {
  48. public static void main (String[] args) throws java.lang.Exception
  49. {
  50. new Ideone().Meh();
  51. blah();
  52. }
  53.  
  54. public void Meh() {
  55. Bar.super.Bar();
  56. Bar.super.Meh();
  57. System.out.println("Ideone.Meh -- Test: "+test);
  58.  
  59. Foo.super.Meh();
  60. super.Meh();
  61.  
  62.  
  63. Bar hack = new Bar(){
  64.  
  65. public static final String test="over";
  66.  
  67. public String getTest(){
  68. System.out.println("Ideone.Meh.hack.super.test: " + Bar.super.getTest());
  69. return test;
  70. }
  71.  
  72. public void Meh(){
  73. System.out.println("Ideone.Meh.hack.Meh()");
  74.  
  75. func();
  76. Bar.Sup();
  77. Bar.super.Meh();
  78. }
  79.  
  80. public void func(){
  81. System.out.println("Ideone.Meh.hack.func -- Test: "+test);
  82. }
  83. };
  84.  
  85. hack.Meh();
  86. System.out.println("Ideone.Meh.hack.test: " + hack.test);
  87. hack.mega();
  88. hack.doTest();
  89. }
  90.  
  91. public static void blah() {
  92.  
  93. }
  94. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
Bar.Bar()
Bar.Meh -- Test: t
Ideone.Meh -- Test: t
Foo.Meh
Test.Meh
Ideone.Meh.hack.Meh()
Ideone.Meh.hack.func -- Test: over
Bar.Sup -- Test: t
Bar.Meh -- Test: t
Ideone.Meh.hack.test: t
Ideone.Meh.hack.Meh()
Ideone.Meh.hack.func -- Test: over
Bar.Sup -- Test: t
Bar.Meh -- Test: t
Ideone.Meh.hack.super.test: t
Bar.doTest: -- getTestover