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...
Type: Posts; User: Alaa
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...
hello,
try the equal method instead of == operator and see what you get which in your case:
if(check.nextLine().equals(username))
{...}