Is that normal ? (error with strings)

edited October 2016 in Questions about Code

Hello, I don't understand the problem with the following code. Is that normal ? Please, have someone an answer ? Thanks !

String text1="A";

String text2="A ...";

String[] text3=split(text2,' ');

String text4=text3[0];// text4= the first part of text2 ="A"

//Printing it, I see it's the same

println(text4); // prints "A"

println(text1); // prints exactly the same

// But...

println(text4==text1); // say that it wasn't the same; why is "A"(from text1) not "A"(from text4) ??

Tagged:

Answers

Sign In or Register to comment.