ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
why the equals method can be override?when we override the
equals method?
 Question Submitted By :: Mahebsc
I also faced this Question!!     Rank Answer Posted By  
 
  Re: why the equals method can be override?when we override the equals method?
Answer
# 1
question is not clear
may ur question is 
why hashcode() will be override when u override equals()? 
is it
 
Is This Answer Correct ?    2 Yes 0 No
Dsureshkumar28
 
  Re: why the equals method can be override?when we override the equals method?
Answer
# 2
equals method available in object class is for address
comparison not  for  content comparison.so for content
comparison we have to override equals method in our class.
wrapper classes and string class has overridden equals
method for content comparison.
 
Is This Answer Correct ?    4 Yes 1 No
Subhareddy
 
 
 
  Re: why the equals method can be override?when we override the equals method?
Answer
# 3
to check if 2 objects references to the same memory 
location..
 
Is This Answer Correct ?    0 Yes 2 No
Manju Kt
 
  Re: why the equals method can be override?when we override the equals method?
Answer
# 4
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 ?    1 Yes 0 No
Madhu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Is ResultSet class? Bally-Technologies2
when we have to use final class in java?  2
In what type of containers, Border layout is a default layout?  3
Java support what type of parameter passing ? Wipro6
Keywords in Exceptions?  1
what are depricated methods ? Satyam4
Why would you desing a J2EE application so user data is entered by way of a JSP page and managed by an underlying Java Beans class? Adobe3
which one is performance wise advantageious from List,Set,Map?  5
Difference between canvas class & graphics class?  1
explain System.out.println IBM41
what is mean by method signature? Satyam6
I have a Arraylist object, it has duplecate values also. Now question is i want delete duplecate data in that objet with out using Set? Aricent5
explain the life cycle of thread? CTS5
Difference between the paint() and repaint() methods?  1
Difference between the String and StringBuffer classes?  3
what is Hashmap & Hashtable wirh example? Saksoft4
What is meant by event handling?  1
Name the types of mouse event listeners ?  2
What is the GregorianCalendar class? HCL1
what is the difference between AWT and SWING what is the advantage of using swing?  3
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com