Implement a Java program to count the number of vowels and consonants in a string.
Here’s a Java program to count the number of vowels and consonants in a string: import java.util.Scanner; public class VowelConsonant { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print(“Enter a string: “); String str = scanner.nextLine(); int vowelCount = 0, consonantCount = 0; str = str.toLowerCase(); for (int i = 0; … Read more