Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

BlueJ Program on Letter or Digit Checking in a sentence



import java.io.*;
class LetterCh
{
  BufferedReader br=new BufferedReader (new InputStreamReader(System.in));
int I,len,c=0;
char ch;
public Void showLettersDigits () throws Exception
{
 System.out.print("\nEnter the sentence:");
String str=br.readLine();
str=str.trim();
len=str.length ();
for (i=0;i

{
ch= str.charAt(i);
if(Character.isLetterOrDigit(ch))
c++;
}
System.out.print(“Total number of Letters and Digits in the sentence=”+c);
}

public static void main(String args[])
{
LetterCh ob=new LetterCh ();
ob. showLettersDigits();
}
}




This post first appeared on Tutorial Site On Computer Programming Languages F, please read the originial post: here

Share the post

BlueJ Program on Letter or Digit Checking in a sentence

×

Subscribe to Tutorial Site On Computer Programming Languages F

Get updates delivered right to your inbox!

Thank you for your subscription

×