fork download
  1. interface MathConstants{
  2. double PI_VALUE = 3.14;
  3. int VALUE = 10;
  4.  
  5. void fun();
  6.  
  7. default void calculate(int a, int b){
  8. System.out.println(a + b);
  9. subtract(a, b);
  10. }
  11.  
  12. static void sum(int a, int b){
  13. System.out.println(a + b);
  14. }
  15.  
  16. private void subtract(int a, int b){
  17. System.out.println(a - b);
  18. }
  19. }
  20.  
  21. class Random implements MathConstants{
  22. public void fun(){
  23. System.out.println(PI_VALUE);
  24. }
  25. }
  26. class Ideone
  27. {
  28. public static void main (String[] args)
  29. {
  30. MathConstants f = new Random();
  31. f.fun();
  32. f.calculate(9,6);
  33. MathConstants.sum(2,6);
  34. }
  35. }
Success #stdin #stdout 0.07s 53008KB
stdin
Standard input is empty
stdout
3.14
15
3
8