Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    The point is that the println() *does* run in the first example when the if statement evaluates to false. It's still a reachable statement. In the second example, there's no way that the code could...
  2. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    I don't think you quite understand the question.

    In the first code example, the if statement does not have any curly brackets. That means that when the if statement evaluates to true, only the...
  3. Re: What is the difference between a statement surrounded by curly brackets and one that isn't?

    This code:


    if (number < 1 || number > 100 )
    throw new InvalidInputException();
    System.out.println("You entered " + number);


    Should be re-written as this:
Results 1 to 3 of 3