Answer
//countStrings Method
public class countStrings {
public int Arraycount(String[] arrray, String target) {
int count = 0;
for(String elem : arrray) {
if (elem.equals(target)) {
count++;
}
}
return count;
}
// Body
public static void main(String args [] ) {
countStrings ccount = new countStrings();
int kount = ccount.Arraycount(new String[]{"Sick", "Health", "Hospital","Strength","Health"}, " Health"
System.out.println(kount);
}
}
The Program above is written in Java programming language.
It's Divided into two parts
The first is the method countStrings
While the second part of the program is the main method for the program execution