Question: Rewrite Programming Exercise 6.23 using streams. Data from Programming Exercise 6.23 Write a method that finds the number of occurrences of a specified character in
Rewrite Programming Exercise 6.23 using streams.
Data from Programming Exercise 6.23
Write a method that finds the number of occurrences of a specified character in a string using the following header:
public static int count(String str, char a)
For example, count("Welcome", 'e') returns 2. Write a test program that prompts the user to enter a string followed by a character then displays the number of occurrences of the character in the string.
Step by Step Solution
3.51 Rating (164 Votes )
There are 3 Steps involved in it
import javautilstreamStream public class Exercise3013 public static void mainString args P... View full answer
Get step-by-step solutions from verified subject matter experts
