In the following statements:
String string1 = new String("This is a string");
String string2 = new String("this is another string");
system.out.println(string1.equals(string2));
is it safe to say that the println
method is dependent on the equals()
method, which is dependent on the String object "string2"?
My question is not regarding the output of the code but rather whether or not the explanation of dependencies is accurate.