Answer:
import java.util.Scanner;
public class ANot {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Please enter a word");
String word = in.next();
System.out.println("Please enter a character");
char ca = in.next().charAt(0);
int countVariable = 0;
for(int i=0; i<word.length(); i++){
if(ca ==word.charAt(i))
countVariable++;
}
System.out.println(countVariable);
}
}
Explanation: