fork download
  1. import java.util.Arrays;
  2.  
  3. class Foo {
  4. int x;
  5. public Foo(int x) {
  6. this.x = x;
  7. }
  8. private int add(int... args) {
  9. return Arrays.stream(args).reduce(this.x, (accum, value) -> accum + value);
  10. }
  11. private int sub(int... args) {
  12. return Arrays.stream(args).reduce(this.x, (accum, value) -> accum - value);
  13. }
  14. private int mul(int... args) {
  15. return Arrays.stream(args).reduce(this.x, (accum, value) -> accum * value);
  16. }
  17. private int div(int... args) {
  18. return Arrays.stream(args).reduce(this.x, (accum, value) -> accum / value);
  19. }
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
spoj: The program compiled successfully, but main class was not found.
      Main class should contain method: public static void main (String[] args).
stdout
Standard output is empty