import java.util.*;
public class PrintLetterDigitSpace{
public static void main(String args[]){
String str = "A quick brown fox jumps over @113 lazy dogs";
counter(str);
}
public static void counter(String s){
char[] ch = s.toCharArray();
int letter = 0;
int number = 0;
int space =0;
int other =0;
for(int i=0; i<s.length();i++){
if(Character.isLetter(ch[i])){
letter++;
} else if(Character.isSpaceChar(ch[i])){
space++;
} else if (Character.isDigit(ch[i])){
number++;
} else{
other++;
}
}
System.out.println("No. of letters in the given string are : " + letter);
System.out.println("No. of spaces in the given string are : " + space);
System.out.println("No. of digits in the given string are : " + number);
System.out.println("No. of others in the given string are : " + other);
}
}