public class Find
{ public void main(String[] args)
{ System.out.println("Please enter a String.");
try
{ isr = new InputStreamReader(System.in);
br = new BufferReader(isr);
s = br.ReadLine();
}
catch(IOException e)
{ s = "sssssssssss";
}
System.out.println("Please enter a Char.");
try
{ c = br.ReadLine();
}
catch(IOException e)
{ c = "s";
}
for (i = 0; i<s.length() -1; i++)
{ int count = 0;
if (s.charAt(i).equals(c)) count++;
}
System.out.println("the number is " + count);
}
private String s;
private Char c;
private InputStreamReader isr;
private BufferReader br;
}// 我试着做了一个,但无法通过编译,请各位老大指正一下下哈!~