Write a Java program that counts a character from the input string.
public class App {
public static void main(String[] args) throws Exception {
// scanner
Scanner scanner = new Scanner(System.in);
// get the input string
// get the character to count
// count the characters
// print the result
scanner.close();
}
}
Enter a string: The Quick BROWN Fox
Enter the character to count: x
x = 1
Enter a string: Hello GALAXY!!!
Enter the character to count: l
l = 3
Enter a string: Hello World!!!
Enter the character to count: !
l = 3