I was reading my SCJP Study Guide (PDF format, on my iPhone) while waiting for my turn at a barber shop. As I was going through one of the sections I fell into a tricky question — all of a sudden found myself craving for a Java compiler.
Just Googled “online java compiler” and found a wonderful resource called Ideone, it allows you to write, compile, debug and run your code online. Besides Java it also supports a multitude of languages (vide image below). To use it, simply refer to this URL: http://www.ideone.com.