Skip to main content
5 of 9
Adding the java tag
Victor Stafusa
  • 8.8k
  • 5
  • 40
  • 61

Tips for golfing in Java

I know I know, not another tips question. But I'm rather surprised that this question hasn't already been posted. At any rate, are there any useful shortcuts that can be used especially in Java?

As shown below, import already adds at least 17 characters to a program.

import java.io.*;

I understand that the simple solution would be to use another language, but it seems to be a real challenge to shorten Java programs.

anon