fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. interface IBase{
  6. int value = 12;
  7. int func();
  8. }
  9.  
  10. class Sub implements IBase{
  11. Sub(){
  12. //
  13. }
  14. public int func(){
  15. return value;
  16. }
  17. }
  18.  
  19. class Ideone
  20. {
  21. public static void main (String[] args) throws java.lang.Exception
  22. {
  23. Sub sub = new Sub();
  24. System.out.println(sub.value);
  25. System.out.println(sub.func());
  26.  
  27. IBase base = new Sub();
  28. System.out.println(base.value);
  29. System.out.println(sub.func());
  30. }
  31. }
Success #stdin #stdout 0.08s 47004KB
stdin
Standard input is empty
stdout
12
12
12
12