How can you say HashMap is syncronized?

Answer Posted / aruna kadaari

By using the below statment we can stnchronize the hashmap


Hashmap hm = new Hashmap();
Map m = Collections.synchronizedMap(hm);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What class allows you to read objects directly from a stream?

876


What is broken and continue statement?

535


Are there structures in java?

560


How do generics work in java?

524


What does string intern() method do?

590






How do you check whether the list is empty or not in java?

518


What is mnemonic code?

543


What is the difference between equals() and?

591


What is the purpose of void?

540


Is java hashset ordered?

580


What is the difference between the prefix and postfix forms of the ++ operator?

557


Is static variable stored in heap?

509


How would you format a date in java? I.e. In the ddmmyyy format?

780


What is byte [] in java?

540


what is the difference between a threads start() and run() methods? : Java thread

529