My code below is compile error. The local available may not has been initialized
String str;
my_obj.setValue(str);
and fixed by this
String str = null;
my_obj.setValue(str);
So is null instance of anything? What is the difference between null and not initialized.
Why does it work for this way?
My Class
class MyClass {
String str;
}
I have initialized obj not obj.str. but no such a compile error that ways...
MyClass obj = new MyClass();
my_obj.setValue(str);
I already read what all of you recommend before I post this questions. Maybe it duplicated, but I didn't get any idea form those.