Write a program in java to input a sentence and count the number of alphabets in
small letters, number of alphabets in capital letters and number of whitespaces and display them. Use Character wrapper class.
Answers
Answered by
0
Answer:
public class CountCharacter.
{
public static void main(String[] args) {
String string = "The best of both worlds";
int count = 0;
//Counts each character except space.
for(int i = 0; i < string. length(); i++) {
if(string. charAt(i) != ' ')
Similar questions
Math,
2 months ago
Social Sciences,
2 months ago
Social Sciences,
2 months ago
Math,
5 months ago
Science,
5 months ago
Math,
10 months ago