public class ex1 {
public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println("Please enter a series of strings each followed by the enter key. When you'd like to end thr program simply type 'quit': \n");
    Scanner scan = new Scanner(System.in);
    ArrayList<String> inputList = new ArrayList<String>(); // creates a list to store user input
    String input = scan.nextLine(); //takes the scanner input
    while(input != "quit") { //makes sure its not equal to quit
        //System.out.println(input);
        inputList.add(input);
        input = scan.nextLine();
    }
    scan.close();       
    System.out.println("The number of strings enetered was: " + inputList.size());
    System.out.println("The strings you entered were as follows");
    for (String i: inputList) {
        System.out.println(i);
    }
} }
I'm trying to use the preceding code to take a series of inputs from a user using the enter key and if they enter quit I end the program. However the condition is never satisfied and the while loop never ends and I can't understand why
 
     
    