A user inputs a website which only stops when 'stop' is typed in the input then the total of websites are totaled together.
I'm just wondering what I'm doing wrong with my code.
public class Project60
{
public static void main (String [] args)
{
String website;
int websiteCount = 0;
String stop = "stop";
Scanner scan = new Scanner(System.in);
System.out.print("Please enter a website URL (e.g. www.rrc.ca) : ");
website = scan.nextLine();
System.out.println("(repeat above until user enters stop)");
while( website != "stop")
{
System.out.print("Please enter a website URL (e.g. www.rrc.ca) : ");
website = scan.nextLine();
System.out.println("(repeat above until user enters stop)");
websiteCount++;
}
System.out.println("There were " + websiteCount + " commercial websites entered");
}
}