Why it keeps looping even i try to stop it?
<p>I am supposed to write a program that asks the user "Do you love java?" and keep prompting the user for an answer.If the user enters "yes" or "no",print "thank you" and quit the program.Otherwise,print "try again" and then prompt user again.</p>

<pre><code>import java.util.*;
public class Questionaire{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);

        System.out.print("Do you love java? &gt; ");
        String output=sc.nextLine();

        while(!output.equalsIgnoreCase("yes") || !output.equalsIgnoreCase("no")){

            System.out.println("Try again!");
            System.out.print("Do you love java? &gt; ");
            output=sc.nextLine();
            if(output.equalsIgnoreCase("yes") || output.equalsIgnoreCase("no")){
                System.out.println("Thank you!");
                break;
            }
        }

    }
}
</code></pre>

<p>Read through the comments and attempt it on my own again.</p>

<pre><code>import java.util.*;
public class Questionaire{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);

        System.out.print("Do you love java? &gt; ");
        String output=sc.nextLine();

        while(!output.equalsIgnoreCase("yes") || !output.equalsIgnoreCase("no")){
            if(output.equalsIgnoreCase("yes") || output.equalsIgnoreCase("no")){
                System.out.println("Thank you!");
                break;
            }

            System.out.println("Try again!");
            System.out.print("Do you love java? &gt; ");
            output=sc.nextLine();

        }



    }
}
</code></pre>

<p>And i got it!!!Thanks people!</p>
