SK
BAN USER
Questions (2)
Comments (2)
Reputation 10
- 0of 0 votes
AnswersIn a hashmap, how to delete all the odd entries? i.e, if hash map contains key1, value1, key2, value2, key3, value3, ... we've to delete all the odd entries, that is to remove all the keys alone without deleting values
- SK in United States| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswersJAVA Question:
- SK in United States
There is one class which extends Thread and it takes "Symbol (Clubs, Heart, Dice, Spade)" as a parameter in constructor.
We've four threads one each for each symbol. Now they want to print as given below:
Dice A
Hearts A
Spade A
Clubs A
Dice 2
Hearts 2
Spade 2
Clubs 2
and so on...
How to achieve this. I thought of using wait/notify, but we've to some how make sure that each thread gets run in a particular order to print this.| Report Duplicate | Flag | PURGE
Threads
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
No, it won't throw concurrentModification exception if you traverse using iterator, and remove using iterator.remove method.
- SK November 03, 2012