What The $

Ryan Sonnek bio photo By Ryan Sonnek

Here’s a little snippit that could end up on The Daily WTF.

Is anyone out there familiar with how Java compiles inner classes? Sure, they append a $ to the inner class name. Now, suppose some developer knows the inner workings of the Java compiler and wants to make the compiler’s job easier. What would you do? Of course! You’d name your inner class starting with a $! This should make compilation time much quicker, and it leaves an amazing legacy of source code for future developers.

public class Foo {
  private class $Bar {