fork download
  1. import java.util.*;
  2. class mymath
  3. { long a; long b;
  4.  
  5. long add(){System.out.println("instance");return a+b;}
  6. long sub(){System.out.println("instance");return a-b;}
  7. long mul(){System.out.println("instance");return a*b;}
  8. long div(){System.out.println("instance");return a/b;}
  9.  
  10.  
  11. static long add(long a, long b){return a+b;}
  12. static long sub(long a, long b){return a-b;}
  13. static long mul(long a, long b){return a*b;}
  14. static long div(long a, long b){return a/b;}
  15. }
  16.  
  17.  
  18. public class static_method {
  19. public static void main(String[] args)
  20. {
  21. System.out.println(mymath.add(20L, 30L));
  22. }
  23.  
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:18: error: class static_method is public, should be declared in a file named static_method.java
public class static_method {
       ^
1 error
stdout
Standard output is empty