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

BlueJ Program on Digit Checking in a sentence

Tags: void


class DigitCh
{

int I,len,c=0;
char ch;
public Void showDigits (String str)
{
str=str.trim();
len=str.length ();
for (i=0;i

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

public static void main(String args[])
{
DigitCh ob=new DigitCh ();
ob. showDigits(“abcd123”);
}
}




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

Share the post

BlueJ Program on 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

×