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   SiteMap shows list of All Categories in this site.
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
What is difference between hash mapping and hash table?
 Question Submitted By :: Sumita
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is difference between hash mapping and hash table?
Answer
# 1
Both provide key-value access to data. The Hashtable is one 
of the original collection classes in Java. HashMap is part 
of the new Collections Framework, added with Java 2, v1.2.
The key difference between the two is that access to the 
Hashtable is synchronized on the table while access to the 
HashMap isn't. You can add it, but it isn't there by 
default.

Another difference is that iterator in the HashMap is fail-
safe while the enumerator for the Hashtable isn't. If you 
change the map while iterating, you'll know.

And, a third difference is that HashMap permits null values 
in it, while Hashtable doesn't. 

For new code, I would tend to always use HashMap.
 
Is This Answer Correct ?    0 Yes 0 No
Khalid
 
  Re: What is difference between hash mapping and hash table?
Answer
# 2
Both provide key-value access to data. The Hashtable is one 
of the original collection classes in Java. HashMap is part 
of the new Collections Framework, added with Java 2, v1.2.
The key difference between the two is that access to the 
Hashtable is synchronized on the table while access to the 
HashMap isn't. You can add it, but it isn't there by 
default.

Another difference is that iterator in the HashMap is fail-
safe while the enumerator for the Hashtable isn't. If you 
change the map while iterating, you'll know.

And, a third difference is that HashMap permits null values 
in it, while Hashtable doesn't. 

For new code, I would tend to always use HashMap.
 
Is This Answer Correct ?    0 Yes 0 No
Khalid
 
 
 
  Re: What is difference between hash mapping and hash table?
Answer
# 3
Yes... I agree with u khalid.
can u send the examples in CFW.
Thanks in Advance.
 
Is This Answer Correct ?    0 Yes 0 No
Sandya
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
what is difference between front controller and action servlet?  1
Describe inheritance as applied to java?  4
Difference between String & StringBuffer  6
What Method and class used for Connection pooling ? Wipro2
When does the compiler supply a default constructor for a class? TCS7
why marker interfaces are there in java Digital-Group2
What is an Exception ?  5
How to convert a string to long?  2
What is the GregorianCalendar class? HCL1
what is struts-config-xml?and its use?  3
what is mean by overriding in which situation we wil use? Atlas-Systems4
Can a for statement loop indefinitely?  3
Difference between ?System.out.println? and ?System.error.println?? Sai-Softech2
What is 'finally' method in Exceptions?  2
who was the founder of java HCL5
What modifiers are used with an inner class which is a member of an outerclass?  1
Different types of modifiers? RoboCom2
Can you declare a static variable in a method?  3
If all the methods in abstract class are declared as abstract then what is difference between abstract class and in interface? Synechron4
Why null interfaces are used in Java?  2
 
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