image1 image2 image3

HELLO I'M NITENDRA THAKUR|WELCOME TO MY PERSONAL BLOG|I LOVE TO DO CREATIVE THINGS|I'M PROFESSIONAL ANDROID APPLICATION DEVELOPER

JAVA CODINGS

java code for calculating the characters in java ;

class  anonymous
{
  static int charcount(String s)
  { int count=0;
   for(int i=0;i<s.length();i++)
   {
     char ch=s.charAt(i);
      String s1=s.valueOf(ch);
      byte b[]=s1.getBytes();
      String s2=new String(" ");
      byte c[]=s2.getBytes();
       if(b[0]==c[0])
       {
        count=count;
       }
       else
       {
       count=count+1;
       }
    }
    return count;
   
   }
  public static void main(String a[])
  {
   System.out.println(charcount("wings of fire by Mr. Kalam"));
  }
}

Share this:

CONVERSATION

0 comments:

Post a Comment