title: Creating a map in Java
body: <p>Im wanting to create a map with a float (or double) key and a char value.
  I have:</p>
  
  <pre><code>Map&lt;double, char&gt; memory = new HashMap&lt;double, char&gt;();
  </code></pre>
  
  <p>However this is returning errors when compiling.
  The errors are saying unexpected error type for all 4 types (left and right).
  Another error says: type Map does not take parameters
  How do I fix this? Or is there a better approach to making a dictionary?
  Thank you, David</p>
  
  <p><em>Adapted</em>
  The code is now:</p>
  
  <pre><code>Map&lt;Double, Character&gt; memory = new HashMap&lt;Double, Character&gt;();
  </code></pre>
  
  <p>It is in the class named GameLogic.
  But this returns this error message upon compiling:</p>
  
  <pre><code>GameLogic.java:5: type Map does not take parameters
  Map&lt;Double, Character&gt; memory = new HashMap&lt;Double, Character&gt;();
  </code></pre>
  
  <p>Extended code:</p>
  
  <pre><code>public class GameLogic
  {
      Map&lt;Double, Character&gt; memory = new HashMap&lt;Double, Character&gt;();
      public static int position;
      public static char currentBlock;
      public static int currentGold;
      public static int startingPosition;
  
  
  
  public GameLogic()
  {
      currentGold=0;
  }
  
  
  public void player_position()
  {
  ...
  </code></pre>