Java Quiz

Suche elegante Möglcihkeit das untenstehende Idiom in generischer Form zu implementieren, da ich insbesondere das put gerne vergesse. Any Ideas?

map = ....;

//probably a loop here:
key = ....;

Element element;
if (map.containsKey(key)){
    element=new Element();
//work with element
This entry was posted in Java, Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *