Not sure what is wrong with my code.
I tried to make a program that takes a string str, and char a and checks how many times the char is used in the string.
Example: the string Welcome and the letter e, is 2 times. so the program should print 2.
It compiles but when I run it and enter the information, i cannot get the printing line out.
Heres my code:
public static void main(String args)
Scanner user_input=new Scanner(System.in);
System.out.print("Please enter a word");
System.out.print("Enter the charachter you would like to check for");
System.out.println(" The number of times the letter " +a+ " has been used in the word " +str+ " is " +result);
public static int count( String str, char a)
Re: Not sure what is wrong with my code.