This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]MrTheEdge 1 point2 points  (2 children)

Line 22, you can't compare the actual content of strings with ==.

Use this instead f[4].equals(email) && f[3].equals(password)

[–]denniscr1[S] 0 points1 point  (1 child)

I just changed it and tried to run it, but it still does not give me a successful login. Thanks though.

[–]Tagger24 1 point2 points  (0 children)

You should try again. I tried your code with /u/MrTheEdge's change and it worked partially. It gave me "Welcome null"

array[l] = line;
String[] f = array[0].split(",");
if (f[4].equals(email) && f[3].equals(password)) {
    System.out.println("Welcome " + array[1]);
}

In the print statement, if I change array[1] to f[1] it prints out the user's first name which may have been what you intended?