This Java snippet describes a quote from a movie. Can you find the quote?

void function (int number, int attempts) {

    if (number > 1) {
      do {
      } while (attempts > ++number);
    } else {
      System.out.println('something else');
  } catch (Exception ex) {
    System.out.println('something bad');

  • 1
    $\begingroup$ Where is the try? $\endgroup$ Mar 30, 2016 at 18:31
  • $\begingroup$ Possible duplicate of puzzling.stackexchange.com/questions/29858/program-rebus-vba $\endgroup$ Mar 30, 2016 at 18:48
  • $\begingroup$ Sorry, I didn't see that before I posted. The answer is indeed the same, but the riddle itself seems different enough to me. $\endgroup$
    – Matt
    Mar 30, 2016 at 18:56
  • 1
    $\begingroup$ I can't really agree about the duplicate. Sure, it's the same answer, but it's a different programming language, a different style, and a completely different method of getting that answer. $\endgroup$ Mar 30, 2016 at 18:56

1 Answer 1



Do, or do not. There is no try.


The "catch" is missing the corresponding "try" statement, regardless of how the "do while" evaluates.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.