when I run the program the while loop never stops and i thought i had it right cause my while loop it says while(bookTitle!="done") this means while bookTitle is not equal to done than execute. but when i type in done it still goes into the loop. can someone tell me what i am doing wrong? Please
// BookSales.java - This program calculates the total of daily
sales for a bookstore.
// Input: Book title and book transaction amount.
// Output: Prints the total of your book sales.
import javax.swing.JOptionPane;
public class BookSales
{
public static void main(String args[])
{
String bookTitle=""; // Title of book.
String stringAmount;
double bookAmount;
double sum = 0;
bookTitle = JOptionPane.showInputDialog( "Enter title of book or
the word done to quit.");
while(bookTitle!="done"){
stringAmount = JOptionPane.showInputDialog("Enter price of book");
bookAmount = Double.parseDouble(stringAmount);
sum+=bookAmount;
bookTitle = JOptionPane.showInputDialog( "Enter title of book or
the word done to quit.");
}
System.out.println("Sum of daily book sales is $:
" + sum);
System.exit(0);
} // End of main() method.
} // End of BookSales class.