Question: Write a Java method called countOccurrences that takes in two parameters - a String called text and a char called target. The method should count
Write a Java method called countOccurrences that takes in two parameters a String called text and a char called target. The method should count the number of times the target character appears in the text string using a for loop and return the count.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
