Count vowels from the given string

This program demonstrate how to count the vowels from the given string

import java.io.*;

public class CountvowelsFromString {
public static void main(String[] args) {
int vowelcounter = 0;
try {
DataInputStream in = new DataInputStream(System.in);
System.out.print(“Enter Any Data :- “);
String str = in.readLine();

for (int i = 0; i < str.length(); i++) {
if (str.charAt(i) == ‘C’ || str.charAt(i) == ‘c’
|| str.charAt(i) == ‘O’ || str.charAt(i) == ‘o’
|| str.charAt(i) == ‘L’ || str.charAt(i) == ‘l’
|| str.charAt(i) == ‘R’ || str.charAt(i) == ‘r’
|| str.charAt(i) == ‘W’ || str.charAt(i) == ‘w’) {
vowelcounter++;
}
}
System.out.println(“Total number of vowels in given string = ”
+ vowelcounter);
} catch (Exception e) {
System.out.println(e);
}
}
}