public class StringTest {
static
String str1;
static String str2;
public static void main( String [] arg){
str2 = str1 + str2 ;
System.out.println ( "str2 : " + str2);
System.out.println ( "str2 == null " + (str2 == null ));}
}
As the strings str1 and str2 were not initialized, they are null. Why after
str2 = str1 + str2
I was expected str2 to still be null but the output is:
str2 : nullnull
str2 == null false
and I do not understand why. str1 and str2 are both null not having value "null", so I do not understand from where there is that nullnull value.
Thanks