My coworker wrote this on a sticky note and told me to type it exactly into a java thingy online and hit “run.” Should I do this?


void never


  If  (334 ➗ 1 ==o)    neverend();




6 Answers

  • 8 months ago

    334 / 1 will never equal 0 so it will keep calling itself infinitely lol.

  • Chris
    Lv 7
    9 months ago

    If I turn this into valid Java and run it I get a stack overflow error as expected: (that link shows the result, it won't run the program)

  • ?
    Lv 5
    9 months ago

    Looks like it is supposed to be a recursive function that will overflow the stack, and cause the system to crash.

    I knew some guys who managed to to this on a Xerox BTM (Batch Timesharing Monitor) system in the 70s.

    But modern commercial Operating Systems will just kill the user process when the stack overflows.

    50 years ago this was sort of cool and hackerish. But now it is just lame.

  • 9 months ago

    I don't see this doing anything, don't think the syntax is right for Java either.

  • What do you think of the answers? You can sign in to give your opinion on the answer.
  • 9 months ago

    It won't do anything.  It's not valid Java, or anything else as far as I can tell. 

    1. You can't have a newline in the middle of a function name.

    2. Keywords "if", "else" and "return" are not capitalized.

    3. The division operator is /, not ÷.

    4. The name "o" is undefined.  Maybe he meant "0" (zero) instead?

    Even if you fixed those, that's a method definition--code that say what to do when the method is called.  It won't run unless it's called; and that needs a line added to some method that does run to perform that call.

    And, finally, depending on where that neverend() method is compared to where it's called from, you might need to and keywords "public" and/or "static" in front of void.

  • 9 months ago

    It's recursive function that calls itself all the time, it will probably just timeout or crash your web instance. If you're using your own IDE, then it may freeze  your pc for a while.

    Run it, nothing wrong with doing it

Still have questions? Get answers by asking now.