the object created at line 1 shud be garbage collected after the call of makeThisNull in main as m is pass by reference so assigning pm to null will reflect m . but the answer given by enthuware tests is that its not garbage collected till the end of the program
Why do you refuse each time to use code-tags to make (valid) code snippets (with proper indentation) more readible for other ranchers? It will also increase your chances to get an appropriate answer on your questions/doubts?
You've probably already read the last comment in the code posted by E Armitage, but I'll just copy and post it again.
* Notes: Java is pass by value always. Pass-by-value means that when you call a method, a copy of the value of each actual parameter is passed to the method. You can change that
* copy inside the method, but this will have no effect on the calling method.
* If the variable you are passing in is of reference type and you change the properties of the referred
* to object without pointing the reference to a new object then your changes will be visible in the calling method. The reference was still passed by value.