Java code comments

Nea trick to hide code inside comments by closing enclosing code using unicode:


public class Dafuq {
    /**
     * This does not do what you think it does.
     * <p>
     * You think code is documentation? No! Documentation is code!
      \u002a\u002f
       static {
           out.println("No");
           exit(0);
       }
      \u002f\u002a
     */
    public static void main(String[] args) {
        out.println("Yes");
    }
}

The above code prints “NO”, and taken from here.

The above does only work for child processes (stared by the same shell). The hack works for any processes:

$ tail --pid=$pid -f /dev/null

Learned from to StackOverflow answer.