Here is a thing that I cannot say, I am surprised that this will not work, but I am interested to find an explanation for this case. Imagine we have an object:
SomeClass someClass = null;
And the method that will take this object as a parameter to initialize it:
public void initialize(SomeClass someClass) { someClass = new SomeClass(); }
And then when we call:
initialize(someClass); System.out.println("" + someClass);
He will print:
null
Thank you for your responses!
Egor
source share