fork download
  1. class A{
  2. public int n;
  3. };
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args)
  8. {
  9. A a = new A();
  10. a.n = 5;
  11. A b = new A();
  12. b = a;
  13. a.n = 10;
  14. System.out.println(b.n);
  15. }
  16. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
10