Answers for "switch case lettre number to letter java"

1

switch case java with char

public class SwitCase {
    public static void main (String[] args){
        String hello = JOptionPane.showInputDialog("Input a letter: ");
        char hi = hello.charAt(0); //get the first char.
        
      switch(hi)
        {
            case 'a': System.out.println("a");
        }
    }   
}
Posted by: Guest on May-31-2021
1

how to convert char to uppercase java

char first = Character.toUpperCase(userIdea.charAt(0));
betterIdea = first + userIdea.substring(1);
Posted by: Guest on June-21-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language