Hello, i'm trying to make a program that checks for your username and password which are stored in strings, it seems to take the else route everytime i enter the username right though.
import java.util.Scanner; public class passwordCheck { public static void main(String args[]){ String password = "test123"; String username = "variumzky"; Scanner check = new Scanner(System.in); System.out.println("Enter your username here:"); if (check.nextLine() == username){ System.out.println("Enter your password"); }else{ System.out.println("No username like that was recognized in our database"); check.close(); } } }