Kaustubh G Sharma wrote:Yeah that I understand, but is there any difference In their execution?
No. The only difference between those two statements is that with the second one there will be no reference to the object in the calling code. As soon as the method returns (assuming no new references to it were created in the method) the object will be eligible for garbage collection, whereas in the first one it won't because 'e' is still referencing it.
subject: Difference between passing by a reference and passing a new object??