Here's a thing that I can't tell I'm surprised it won't work, but anyway it's interesting for me to find the explanation of this case. Imagine we have an object:
SomeClass someClass = null;
And a 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);
It will print:
null
Thanks for your answers!