Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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");
        }
    }   
}
Comment

PREVIOUS NEXT
Code Example
Java :: android html to bitmap 
Java :: java array loop 
Java :: java arraylist deep copy 
Java :: Java Insert Elements to HashSet 
Java :: char to unicode java 
Java :: spring boot base url 
Java :: fill two dimensional array rows by rows java 
Java :: string to stream java 
Java :: write an infinite loop java 
Java :: Java Create ArrayList in Java 
Java :: sort a string array java 
Java :: abs in java 
Java :: java base64 
Java :: android studio change launcher icon 
Java :: addall java 
Java :: java read file 
Java :: java split string array 
Java :: statusbar text color android 
Java :: how to center a window in java 
Java :: write files with FileOutPutStream java 
Java :: java printf 
Java :: java substring after last char 
Java :: java url 
Java :: java read a line of input 
Java :: java list of arrays 
Java :: java vector push_back 
Java :: how to change color of drawable in android 
Java :: json array get json object 
Java :: what coding language is minecraft 
Java :: how to turna date into a LocalDateTime java 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =