Search:

Type: Posts; User: Rend

Search: Search took 0.09 seconds.

  1. Thread: Java error

    by Rend
    Replies
    8
    Views
    1,238

    Re: Java error

    Scanner scan = new Scanner(System.in);
    System.out.println("Enter letter: ");
    a = scan.next();
    int count = 0;

    for (int i = 0; i < a.length(); i++) { ...
  2. Thread: Java error

    by Rend
    Replies
    8
    Views
    1,238

    Re: Java error

    if ((word.indexOf(a)!=-1))

    This is not the right way to check through the string for a letter. What you're actually doing is checking the index of the letter you are looking for (in this case "a")...
Results 1 to 2 of 2