06-operador-ternario.java 188 B

12345678910
  1. class Main {
  2. public static void main(String[] args) {
  3. int age = 17;
  4. String status = (age >= 18) ? "Adulto" : "Menor";
  5. System.out.println("La persona es: " + status);
  6. }
  7. }