Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why HashTable not allow null key and value

Answer Posted / naveen

There is null check in the put method implementation of
hashtable, so it does not support null values and null keys.


public Object put(Object key, Object value) {
// Make sure the value is not null
if (value == null) throw new NullPointerException();
}

above is HashTable put method logic implemented by Sun.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a code to create a trigger to call a stored procedure

979


What are recursive functions? Give some examples?

1193


why java uses class level type casting ?

2665


What is a platform?

1078


When is the arraystoreexception thrown?

1025


What does .equals do in java?

1099


What is lazy initialization in java?

1013


what is aggregation in java?

1016


Can a class have 2 constructors?

899


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

992


What is native method in java?

1061


Can singleton class be serialized?

950


What is the difference between final, finally and finalize()?

1156


How to perform binary search in java?

999


Using callable statement how can you pass out parameters, explain with example?

1229