Interview Preparation mode beta
Funny Facebook Status Funny Facebook Status
Enter your email address

What would you use to compare two String variables - the operator == or the method equals()?

Nice?Vote!

1 Answer

Nice?Vote!
I'd use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.
answered 1 year ago by anonymous

Related questions