Is it possible to compare various strings with the help of == operator? What are the risks involved?
Answer / Raj Kapoor
It is possible to compare strings using the '==' operator, but doing so can lead to unexpected results. The '==' operator checks if both objects refer to the same memory location (i.e., if they are instances of the same String object). This may not always be desirable or accurate as it does not verify whether the content of both strings is identical. Using the equals() method for string comparison is strongly recommended.
| Is This Answer Correct ? | 0 Yes | 0 No |
What makes a function well defined?
Write a program in java to find the maximum and minimum value node from a circular linked list.
What is == in java?
using equals method overriding which objects are compared?i.e same class objects or other class objects?Explain me.
What is a java lambda expression?
What is an empty string in css?
What is considered an anti pattern?
What is functional interface in java?
How do you sort arraylist in descending order?
What is the difference between assignment and initialization?
How is a structure different from array ?
What is public/private protected in java?