Worked example
String x = "cat";
String built = "c";
built = built + "at"; // same characters, built at run time
System.out.println(x == built); // false — different objects!
System.out.println(x.equals(built)); // true — same content
For ordering there is compareTo: it returns a negative number if the first string comes earlier alphabetically, 0 if they are equal, and a positive number if it comes later. Do not memorise the number itself — "apple".compareTo("apricot") gives -2, not -1. Only the sign matters.