public class Test {
public static void main(String[] args) {
String s1 = "Hey";
String s2 = "How are you?";
String s3 = null;
String s4 = null;
String[] s = {s3, s4};
s3 = s1;
s2 = s4;
for(String str : s) {
System.out.println(str);
}
}
}
I Tried this, to give s3 and s4 in array s, the value's of s1 and s2, in another project. Output is null null. I don't understand why it isn't working.