I'm working on a golf for Java and I need an infinite loop. Obviously, I don't want to spend any more bytes than I have to, especially in such an expressive language.
Assuming I have some code I want to run, obviously the baseline is set at while(1>0)/*stmt*/
or 10 additional characters for a single line and while(1>0){/*stmt1*//*stmt2*/}
or 12 additional characters for multiple lines. I say additional because the code I want to loop forever (well, forever-ish... I may or may not want to break out of or return from the loop) will have a certain length, and then I must tack on additional characters to make it actually loop.
At first I thought this was the best I'd get, but I figured I'd throw it out to the experts to see if they can find a better one.
main();
? \$\endgroup\$ – jimmy23013 Sep 2 '15 at 18:08main(null)
. \$\endgroup\$ – Ypnypn Sep 2 '15 at 18:14main(a)
ifmain
is declared aspublic static void main(String[]a)
. \$\endgroup\$ – Dennis Sep 2 '15 at 18:15