Now you might be surprised by thinking that how is it possible to get value of Check object obj variables even though objectReturn() method goes out of scope after returning object obj.It is possible because even though method objectReturn() goes out of scope, Object obj is not destroyed.Because object obj has reference c2 available to it even though objectReturn() method goes out of scope.From this we can conclude that object will exist as long as there is a reference available to it.