Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#FFcccc
public class Container<K,V> {
  Map<K,V> map;

  public void initialize() {
    if(map == null) {
      synchronized(this) {
        if(map != null) {
          map = new HashMap<K,V>();	
        }
      }
    }
  }

  public V get(Object k) {
    if(map != null) {
      return map.get(k);
    } else {
      return null;
    }
  }
}

...