JAVA +  create HashMap in place of function
<p>I write the following two functions
I want to implement the functions with HashMap ( in place of functions )
how to do that?</p>

<pre><code>static void someFunction(int count, int[] anArray)  
{      
  for ( int i=0;i&lt;anArray[count];i = i + 1) 
  {
    System.out.print("#");
  }
  System.out.println("");
} 

static void someFunctionB(int[] anArray , int count,  String stringfinal, String sttr)  
{      
  anArray[count]= stringfinal.replaceAll("[^"+sttr+"]", "").length();
}   

someFunctionB(anArray ,  count,   stringfinal,  sttr  );        

someFunction(count, anArray);  
</code></pre>
