I'm confused; a lot of it has to do with mixing another programmer's code and my own. But right now I'm looking at something and wondering why I never noticed this before. Let's say that I want to use a variable called "MyString" after some other, unrelated stuff in my class, but I keep all the declarations together at the top of the file for simplicity's sake. What is the difference between saying
String MyString = new String();
and
String MyString = null;
(Past the obvious, naturally. For some reason, the answer is not coming to me the way it should!)
In both cases all variables get declared, after that they get initialized.
You wrote the variables outside any method, right? If you do so, they get declared and eentually initialized even before the constructor method is called.