Write a java program to count the letters, spaces, numbers and other characters of an input string.

●1 ●3 ●9
calendar_today • schedule1 min read
  1. First take the input form the user as a string
  2. copy that string into a character array
  3. write logic for checking each character of character array is a letter/number/space/other-character
  4. print all the updated values of variables

Note :- There is pre-built fuctions to copy all characters of string into a character array which is :
char name_of_character_array[ ] = name_of_string.toCharArray and There are also pre-bilut functions are there to check weather character is letter/number/space in an array which are : Character.isLetter(ch[i]) , Character.isDigit(ch[i]) , Character.isSpaceChar(ch[i]) respectively

1 Comment

0 votes
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Understanding Basic Data Structures for Web Development

MasterCraft - Feb 16

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19

Your AI Doesn't Just Write Tests. It Runs Them Too.

Kevin Martinez - May 12

The Audit Trail of Things: Using Hashgraph as a Digital Caliper for Provenance

Ken W. Algerverified - Apr 28

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4
chevron_left
760 Points • 13 Badges
1Posts
36Comments
21Connections
5+ years specialized in Java backend development. Freelance since early 2020.

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!