title: How to convert a map to two dimensional array in java?
body: <p>I want to add all key/value of a Map to a two dimensional array.</p>
  
  <p><strong>Does any body know a better way?</strong>
  I did as below but i search for a better way.</p>
  
  <pre><code>    Map&lt;String, String&gt; memoMap = AvoCollection.getMemoMap();
      String[][] data = new String[memoMap.size()][2];
      int ii =0;
      for(Map.Entry entry : memoMap.entrySet()){
          data[ii][0] = entry.getKey().toString();
          data[ii][1] = entry.getValue().toString();
          ii++;
      }
      final DefaultTableModel model = new DefaultTableModel(data,new String[]{"Memo","ID"});
  </code></pre>