Search:

Type: Posts; User: Alaa

Search: Search took 0.10 seconds.

  1. Replies
    3
    Views
    1,304

    [SOLVED] Re: If condition not working.

    hello,
    think of check.next() and username are different objects since String objects are immutable. you cant compare two objects by == operator however java team provided the method equals to...
  2. Replies
    3
    Views
    1,304

    [SOLVED] Re: If condition not working.

    hello,
    try the equal method instead of == operator and see what you get which in your case:
    if(check.nextLine().equals(username))
    {...}
Results 1 to 2 of 2