public static void main(String[] args) {
String strings[] = {“string”,”starting”,”strong”,”street”,”stir”,”studeng”,”soft”,”string”};
int stcount = 0, ngcount = 0;
for (String str: strings)
{
if (str.startsWith("st"))
stcount++;
if (str.endsWith("ng"))
ngcount++;
}
}
}