What is difference between “==” and equals()?
“==”: It compares references (memory locations). It does not compares values in the memory location. Hence it is not recommended to find the equality of two objects. It is mostly used to compare primitive types.
equals(): It is used to find the equality of two objects. It actually compares with the values that an object contains.
| Is This Answer Correct ? | 5 Yes | 0 No |
What is the finalize method do?
What is string builder?
Why do we need public static void main(String args[]) method in Java...?
How do you create an array in java?
why did you choose your career in IT?
What are parsing rules?
When should I use a singleton?
Explain about public and private access specifiers?
Can a static class implement an interface?
What is a byte array?
Why are strings immutable in Java?
Explain Connection Pooling?