In Java, which one will be used for comparing whether the two string object str 1 and str? are same

In Java, which one will be used for comparing whether the two string object str 1 and str? are same Correct Answer All of the above

String can be compared by using in many ways. Such as if(str 1.equals(str2)); if (str 1.equals Ignore case (str 2) if(str 1.compare to (str 2) = = 0), if (str 1 = = str 2) etc.

Related Questions

Comment on the output of the following C code.
#include int main(){ char *str = "This" //Line 1 char *ptr = "Program\n"; //Line 2 str = ptr; //Line 3 printf("%s, %s\n", str, ptr); //Line 4}
atol(const char *str) Converts the string pointed to, by the argument str.