Method(String, char) not applicable for the arguments()
807606May 16 2007 — edited May 16 2007Hi. Im trying to run this method that I made but I cant coz I always get this error. the ff is my code:
class Sample {
private String word = "apple";
private char a = 'p';
public static void main(String[] args)
{
callingCounter();
}
public int counter(String word, char a)
{
int position = 0;
for (int i=0; i<word.length(); i++)
{
position = word.indexOf(a);
System.out.println(position);
}
return position;
}
public int numberOfLetters(String word, char a)
{
return numberOfLetters;
}
}
thanks a lot