Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • \$\begingroup\$ Yes, and it can calculate the factorial for 0. Put the factorial value in the loop continuation condition. i.e 5 \$\endgroup\$ Commented Aug 6, 2011 at 11:17
  • \$\begingroup\$ Java's a pretty verbose language, so it's not great for getting the lowest character count. \$\endgroup\$ Commented Aug 6, 2011 at 13:34
  • \$\begingroup\$ @Gareth Yeah, but Brain Fuck isn't right? \$\endgroup\$ Commented Aug 7, 2011 at 19:13
  • \$\begingroup\$ You asked why you rarely see Java solutions here - it's because Java's verbose and less likely to win at code-golf. That's not to say there are no Java solutions, or that people shouldn't post Java solutions - they're just rarer for that reason. \$\endgroup\$ Commented Aug 7, 2011 at 20:06
  • 3
    \$\begingroup\$ This is code-golf. With barely any work at all, you can significantly reduce the length by removing unnecessary whitespace and using 1-letter variable names \$\endgroup\$ Commented Feb 5, 2016 at 6:30