Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Koila Malik   on Jun 15 In Java Category.

  
Question Answered By: Whitney Cruz   on Jun 15

> Could you plase tell me the difference  between
hash  Table, hash set  and Hash Map?

HashMap is roughly equivalent to Hashtable, except
that it is unsynchronized and permits nulls. This
class makes no guarantees as to the order of the map;
in particular, it does not guarantee that the order
will remain constant over time.

HashSet implements the Set interface, backed by a hash
table (actually a HashMap instance). It makes no
guarantees as to the iteration order of the set; in
particular, it does not guarantee that the order will
remain constant over time. This class  permits the null
element. This class offers constant time performance
for the basic operations (add, remove, contains and
size), assuming the hash function disperses the
elements properly among the buckets

Hashtable implements a hashtable, which maps keys to
values. Any non-null object can be used as a key or as
a value.

> In JDBC, we are writing  the code  directly using
> Class.forName("Driver details"); and
> Driver Manager.getConnection("======");
without  instatiating the DriverManager instance,
> Why?

getConnection is a static method. You do not need an
instance of the class to use it.

> What is the use of Class.forName("====="); ?

Given a class's name as a string, it returns a
description of the class.

> While serialising the objects, Which objects  cannot
> be serialised apart from transient variables?

no idea, sorry.

Share: 

 
 
Didn't find what you were looking for? Find more on difference between Hash Table, hash set and Hash Map? Or get search suggestion and latest updates.


Tagged: