public class Demo11 {
public static void main(String[] args) {
// 三元运算符
int m = 5;
String s = m > 3 ? “成立” : “不成立”;
// 判断用户名是admin并且密码为666,提示登录成功,否则提示就是玩儿
String username = "admin";
String password = "666";
String msg = username == "admin" && password == "666" ? "登录成功" : "就是玩儿";
System.out.println(msg);
}
}