Search:

Type: Posts; User: Rend

Search: Search took 0.20 seconds.

  1. Re: Getting 1 error in my menu driven code for students add,delete and list.

    What IDE are you using?

    It seems like you need to organize your brackets. Pretty much error is saying your while ( expression ) is after the wrong bracket (not at the end of the do statement.).
  2. Thread: Java error

    by Rend
    Replies
    8
    Views
    1,217

    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++) { ...
  3. Thread: Java error

    by Rend
    Replies
    8
    Views
    1,217

    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")...
  4. Thread: What's wrong?

    by Rend
    Replies
    39
    Views
    2,842

    Re: What's wrong?

    Use .next() instead of .nextLine();

    I forgot specifically why, but .nextLine(); is a little flawed in a way that it sometimes forgets the input or overwrites it.
Results 1 to 4 of 4