Using the knowledge in computational language in JAVA it is possible to write the code being methods define a method named getWordFrequency that takes an array of strings
<h3>Writting the code in JAVA:</h3>
<em>import java.util.*;</em>
<em />
<em>public class WordFrequency {</em>
<em> public static int getWordFrequency(String[] wordsList , int listSize , String currWord) {</em>
<em> HashMap<String , Integer> hm = new HashMap<>();</em>
<em> for(String st : wordsList) {</em>
<em> String str = st.toLowerCase();</em>
<em> hm.put(str, hm.getOrDefault(str, 0) + 1);</em>
<em> }</em>
<em> for(String st : wordsList) {</em>
<em> String str = st.toLowerCase();</em>
<em> System.out.println(st + " " + hm.get(str));</em>
<em> }</em>
<em> String currWordToLowerCase = currWord.toLowerCase();</em>
<em> return hm.get(currWordToLowerCase);</em>
<em> }</em>
<em> public static void main(String[] args) {</em>
<em> // TODO Auto-generated method stub</em>
<em> String[] wordsList = {"hey" , "Hi" , "Mark" , "hi" , "mark"};</em>
<em> int listSize = wordsList.length;</em>
<em> String currWord = "hey";</em>
<em> System.out.println("The frequency of " + currWord + " is : " + getWordFrequency(wordsList , listSize , currWord));</em>
<em> }</em>
<em />
<em>}</em>
See more about JAVA at brainly.com/question/12978370
#SPJ1