equals()用来判断字符串是否相等,相等则返回true,否则返回false。如:
String today="周末";if(today.equals("周末")){ System.out.println("yes");}else System.out.println("error");
输出:yes