If you’re overriding the method equals() of an object, which other method you might also consider?
Answer / Shri Chandra Verma
When overriding the 'equals()' method in a class, it is common to also override the 'hashCode()' method. This is because the 'equals()' and 'hashCode()' methods are often used together in collections like HashSet or HashMap. If the 'hashCode()' method of an object changes over time, it can cause unexpected behavior when dealing with these collections.
| Is This Answer Correct ? | 0 Yes | 0 No |
In an htm form i have a button which makes us to open another page in 15sec.how will you do that?
What is a java singleton?
Why we use beans in java?
When do we go for java 8 stream api? Why do we need to use java 8 stream api in our projects?
What is the meaning of loosely coupled in java?
What are the advantages of java 8’s date and time api over old date api and joda time api?
what is reflection api? How are they implemented?
Explain the encapsulation principle.
Explain about the Physical Data Model?
Explain the reason for each keyword of public static void main(string args[])?
For each of the following program segments,give a big zero analysis for the running time 1.For (i=0;i<m;i++) { // } 2.For (j=0;j<i;j++)
1 Answers St. Pauls University,
Is jvm a compiler or an interpreter?