Difference between == and .equals() ?
Answer / Shailendra Kumar Pandey
== compares the memory location of two objects, while .equals() compares the state (values) of two objects. Objects created with new operator have different memory locations, so == usually returns false for them.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to create an immutable class?
Can a for statement loop indefinitely?
What is an exception in java?
Can we assign null to double in java?
what do you mean by classloader in java?
When garbage collector invokes object?s finalize() method?
Why are constructors used?
Why you should not use singleton?
How do you format in java?
I have one Shopping cart application, i that i have selected some items, while clicking submit button by mistake i have clicked twice or trice, that time items are selected twice or trice. Actually i want only one copy of items but its selected twice or trice. So how can we avoid this problem?
Explain Event handling in AWT?
What are methods in java?