jeudi 22 avril 2021

How can I differentiate between capitalisation in a char?

I want the user to also put a lowercase y into the system. How can I make it recognise it? I apologise in advance if this question seems fairly basic, I'm still new to programming.

 Scanner end = new Scanner(System.in);
      System.out.println("Do you want to quit the program? " +
        "Y - Yes/N - No");
 
      char endchar;
 
      endchar = endenext().charAt(0);
      if (end == 'Y') {
        break;
      }

Aucun commentaire:

Enregistrer un commentaire