SHARE
TWEET

Untitled

a guest Mar 25th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class SwitchDemo{
  2.    
  3.     public static void main(String args[]){
  4.         executeNewSwitchAsStatment("Java SE 12");
  5.     }
  6.  
  7.     public static void executeNewSwitch(String version){
  8.         switch (version) {
  9.             case "JDK Beta", "JDK 1.0", "J2SE 5.0", "Java SE 6", "Java SE 7", "Java SE 9", "Java SE 10" -> System.out.println("Java Old Version");
  10.             case "Java SE 8 (LTS)", "Java SE 11 (LTS)" -> System.out.println("Older version, still supported");
  11.             case "Java SE 12" -> System.out.println("Latest version");
  12.         }
  13.     }
  14.    
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top