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. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. class test {
  13. int a;
  14. int b;
  15. test(int i, int j) {
  16. a = i;
  17. b = j;
  18. }
  19. void meth(test o) {
  20. o.a *= 2;
  21. o.b /= 2;
  22. }
  23. }
  24.  
  25. class Output{
  26. public static void main(String args[])
  27. {
  28. test obj = new test(10 , 20);
  29. obj.meth(obj);
  30. System.out.println(obj.a + " " + obj.b); }
  31. } // your code goes here
  32. }
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:26: error: Illegal static declaration in inner class Output
public static void main(String args[])
                   ^
  modifier 'static' is only allowed in constant variable declarations
1 error
stdout
Standard output is empty