About 28,500 results
Open links in new tab
  1. In Java, is this considered an example of a "nested IF statement"?

    The outer part is an if-else statement, the inner part is a nested if statement. If the else doesn't contain any logic (so you can omit the braces of the else), then it becomes a chained if-else statement.

  2. Alternative to Nested Switch Statements in Java

    Apr 11, 2013 · So I wrote a method today that incorporated the use of nested switch statements, and the code looked fairly clean and concise to me, but I was told that nested switch statements are not …

  3. How to perform nested 'if' statements using Java 8/lambda?

    How to perform nested 'if' statements using Java 8/lambda? Asked 10 years, 8 months ago Modified 5 years, 10 months ago Viewed 66k times

  4. java - Avoiding nested if statements - Stack Overflow

    Dec 3, 2017 · A function should do only one thing, if you have nested if like this your function is certainly doing more than one thing. So that means, each if/else if/else block should then be in its own …

  5. syntax - Java switch statement multiple cases - Stack Overflow

    Feb 23, 2011 · Just trying to figure out how to use many multiple cases for a Java switch statement. Here's an example of what I'm trying to do: switch (variable) { case 5..100: doSomething(); br...

  6. How do I break out of nested loops in Java? - Stack Overflow

    May 20, 2009 · 10 Labeled break concept is used to break out nested loops in java, by using labeled break you can break nesting of loops at any position. Example 1:

  7. java - Breaking out of nested if - Stack Overflow

    IMPORTANT: break statements are used to come out of loops but not branches I understood your question but use break statement to go out of loops like for, while, do while. You can go out of if …

  8. Correct way to write nested if statements? - Stack Overflow

    2 numberHands will be equal to 1,2, or 3. It will never make it this far in the program if not. So I see no reason for else statements. But, is this the correct syntax for writing nested if statements in …

  9. Using nested if statements in Java to calculate letter grade from ...

    Sep 13, 2020 · We are to accomplish this using nested if statements. I attempted to create an outer if statement that would return a letter grade followed by nested if statements that would return the +/- part.

  10. java - How to write nested ?: statements - Stack Overflow

    Jul 13, 2015 · I would like to shorten my code by the use of the ?: (if-else-then) comparative operator instead of using the traditional if{}else{} blocks that inconveniently tend to take over the screen. I was …