please explain whats going on this code..how to draw stack and heap diagram of this code
please help..class A { int i = 34; static A m(A a) { System.out.println(a.i); a.i++; a = new A(); System.out.println(a.i); return a; } public static void main(String[] args) { A a = new A(); m(a); System.out.println(a.i); A a1 = m(a); System.out.println(a.i); } }