why the equals method can be override?when we override the
equals method?
Answer Posted / madhu
equals() method will be available in primodian class that is
Object class, but by default it compares only the addresses,
not the contents, So if you want the content comparison you
have to override equals(), but if u override the equals(),
you have to override the hashCode() also.
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What comes to mind when someone mentions a shallow copy in java?
These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }
What is the largest data type in java?
What is meant by nested loop?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
What is equlas() and hashcode() contract in java? Where does it used?
Does constructor be static?
In how many ways we can do exception handling in java?
How many types of keywords are there?
Is set sorted in java?
What does jenkins do?
Why is the main method static?
Why is stringbuffer called mutable?
If a method is declared as protected, where may the method be accessed in java programming?
What are the two categories of data types in the java programming language?