public class TernaryDemo {
public static void main(String[]args) {
Ternary();
}
private static void Ternary() {
int score =50;
String rank;
rank =score >=90 ?"A" : (score<=89&&score>=60?"B":"C");
System.out.println("rank = " +rank);
}
}
public class TernaryDemo {
public static void main(String[]args) {
Ternary();
}
private static void Ternary() {
int score =50;
String rank;
rank =score >=90 ?"A" : (score<=89&&score>=60?"B":"C");
System.out.println("rank = " +rank);
}
}