title: Adding a new Instance in weka
body: <p>How can I add a new Instance to an existing Instances object that I created ?</p>
  
  <p>Here is an example:</p>
  
  <pre><code>ArrayList&lt;Attribute&gt; atts = new ArrayList&lt;Attribute&gt;(2);
  ArrayList&lt;String&gt; classVal = new ArrayList&lt;String&gt;();
  classVal.add("A");
  classVal.add("B");
  atts.add(new Attribute("content",(ArrayList&lt;String&gt;)null));
  atts.add(new Attribute("@@class@@",classVal));
  
  Instances dataRaw = new Instances("TestInstances",atts,0);
  </code></pre>
  
  <p>I want to add a new instance to dataRaw. As far as I know I have to use dataRaw.add(Instance i) .... How can I create an instance object if the Instance class is an interface ?</p>
  
  <p>Thanks in Advance</p>