By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,162 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,162 IT Pros & Developers. It's quick & easy.

how to remove empty character literal error

P: 1
Expand|Select|Wrap|Line Numbers
  1. import java .io.*;
  2. public class indranil
  3. {
  4.     public static void main(String args [])throws IOException
  5.     {
  6.       BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
  7.       int a,i,l,z;
  8.       System.out.println("enter a number a");
  9.  
  10.         a=Integer.parseInt(in.readLine());
  11.     l=a.length();
  12.     for(i=0;i<l;i++)
  13.     {
  14.      char ch=a.charAt(i);
  15.         if (ch=='')
  16.         {
  17.         z=z+1;
  18.     }
  19. }
  20.  
  21.         System.out.println("the number of spaces in sentence is"+z);
  22.  
  23.     }
  24. }
Dec 9 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.