Any of you peeps want to help a honkey out with his Java? I've to explain what and why a code segment will output.
public static void method3(){
String mystring1 = "Hello World";
String mystring2 = "Hello World";
if (mystring1 == mystring2) { System.out.println("M3 The 2 strings are equal"); }
else { System.out.println("M3 The 2 strings are not equal"); }
}
My answer was marked as incomplete;
/**Following on from both segments, the third segment creates the memory reference 'Hello World'.
* It then assigns the 'mystring2' string the same memory reference.
/* As a result, it will display 'M3 The two strings are equal */
Any help would be much appreciated.