answersLogoWhite

0


Best Answer

Yes, the if the two string objects point to the same memory location. But "==" is not the best way to compare two string objects. Two strings can be compared using obj1.equals(obj2). This compares for the textual equal-ness of the two string objects.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

anil sharma

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What happens when your compare two string objects with the equals operator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does equals equals mean in java?

operator to compare two objects. The simple "=" sign is used for assignment - assigning a value to a variable. Here are examples of the two: x = 15; // Assign the value 15 to the variable if (x == 10) ... // Compare variable "x" with some value


How do you find out not equals string in java?

Remember that strings are objects. You can use the String.equals method to determine equality, and use the ! (not) operator to test for inequality. public static boolean notEquals(String str1, String str2) { return !str1.equals(str2); }


In excel if the formula equals A1 plus B1 what is the operator?

For =A1+B1, the operator is the plus sign (+).


What is the use of 'compareTo' in java?

To compare the contents of two objects. The equality, "=", will simply tell you whether two objects are in the same memory location; it doesn't tell you whether their contents are actually the same. To compare the contents, there is an equals() method which tells you whether the contents are actually equal; there is also a compareTo() which can also tell you which of two objects is "greater". Since objects can be quite complex, the programmer may have to overwrite the (often useless) default behavior of these methods.


How do you use equals equals equals operator in javascript?

'1' will return false because one variable is an integer and the other is a string.


Is x plus equals y is post increment or pre increment?

The '+=' operator behaves like a pre increment operator.


Difference between equals equals and equal in java?

"==" in java is the binary operator which compares two values and gives a boolean result While "=" in java is a assignment operator which assigns a value to a variable.


Use Guassian quadrature with n equals 1 and n equals 2 and compare to exact value I equals compare to exact value?

Use Guassian quadrature with n=1 and n=2 and compare to exact value I=


What is difference between equals and equals equals operators?

The equals operator is used for assigning a value to a variable. ex String name = "efu"; the equals equals operator is used for comparaing if the given value is equal to another value which is assigned for a variable. ex int i = 0; int j = 5; if( i == 0){ System.out.println(j+"can't be divided by"+i); }else{ System.out.println("answer is " +j/i); }


Is a syntax B1-B2B3 is an example of formula in excel?

No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3No. There is no equals sign at the start and the cell reference B2B3 is not valid or has an operator missing. A possible formula variation on it could be:=B1-B2+B3


If I compare bread to crust what can I compare beacon with?

Bread equals crust (outer layer of a loaf).Bacon equals bacon rind (outer layer of the skin of a pig).


What character is used in an OR operator?

The logical OR operator in C and Java is the double vertical bar ().Example: if (s 0) do somethingThe operator applies a logical OR operator when it evaluates the expression.