About 8,600,000 results
Open links in new tab
  1. Use string in switch case in java - Stack Overflow

    Apr 20, 2012 · Simply because Java7+ code using switch over string compiles to code assuming exactly that invariant property. So it can’t change in future versions and it’s even simpler to see …

  2. java - What are switch expressions and how are they different from ...

    Jan 10, 2021 · As part of Java SE 12, switch expressions were introduced and since Java SE 14, they have been standardized. How are they different from switch statements?

  3. java - Switching between different JDK versions in Windows

    Nov 18, 2014 · I'm working on few projects and some of them are using different JDK. Switching between JDK versions is not comfortable. So I was wondering if there is any easy way to …

  4. How to set or change the default Java (JDK) version on macOS?

    How can you change the default version of Java on a mac?

  5. What is the difference between a rule switch and a regular switch …

    Jan 27, 2024 · In the regular switch you can omit to break the execution at the end of a code block. This allows a fall-through, and you can handle several different cases with the same …

  6. Should switch statements always contain a default clause?

    Jan 11, 2011 · If we always use a default clause it might happen that the static code analysis tool is not capable of detecting exhaustive or non-exhaustive switch statements as it always …

  7. java - How to use null in switch - Stack Overflow

    You can use primitives (int, char, short, byte) and String (Strings in java 7 only) in switch. primitives can't be null. Check i in separate condition before switch.

  8. Switch on Enum in Java - Stack Overflow

    You actually can switch on enum s, but you can't switch on String s until Java 7. You might consider using polymorphic method dispatch with Java enum s rather than an explicit switch. …

  9. macos - Mac OS X and multiple Java versions - Stack Overflow

    Using Homebrew to download Java versions and jenv to switch versions provides a nice workflow. jenv makes it easy to work with Java versions stored in any directory on your machine, so it's …

  10. Using java - using if else statement in a switch? - Stack Overflow

    Using java - using if else statement in a switch? Asked 9 years, 8 months ago Modified 9 years, 8 months ago Viewed 5k times