Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created February 28, 2014 01:32
Show Gist options
  • Save ejknapp/9263467 to your computer and use it in GitHub Desktop.
Save ejknapp/9263467 to your computer and use it in GitHub Desktop.
Map Demo for Advanced Java 2/27/2014
package java112.labs2;
import java.io.*;
import java.util.*;
/**
* @author Eric Knapp
* class MapDemo
*/
public class MapDemo {
public void run() {
Map<String, Integer> map = new HashMap<String, Integer>();
map.put("one", 1);
int value = map.get("one");
map.put("one", ++value);
System.out.println(map.get("one"));
}
public static void main(String[] args) {
MapDemo demo = new MapDemo();
demo.run();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment