在java中用字符串变量结束循环

时间:2016-09-03 22:02:58

标签: java loops

当我输入"退出"

时,

在结束此循环时遇到问题

String employee=" ";
double pay;
int hours;
   while(employee != "quit")
 {
    System.out.print("Enter employee name: ");
    employee = input.next();

    System.out.print(employee);
    System.out.println("\n");
}

0 个答案:

没有答案