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 Student{
  9. public int id;
  10.  
  11. }
  12. class Ideone
  13. {
  14. public static void print(Student s){
  15. s.id = 20;
  16. System.out.println(s.id);
  17. }
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. Student s = new Student();
  21. s.id = 10;
  22. System.out.println(s.id);
  23. print(s);
  24. System.out.println(s.id);
  25. }
  26. }
Success #stdin #stdout 0.06s 46924KB
stdin
Standard input is empty
stdout
10
20
20