I think all you need to do is put the local class definition (c1 class) before the c1 c123 = new c1(); line. At least that worked for me. I actually received a compiler error on the original source. Which I think is called a forward reference error(?).
Maria, I believe Tom's explanation is correct. Your code refers to regular inner classes and Sarma's code refers to method-local inner classes. So it looks like when you define a method-local inner class you cannot forward reference it like you can with a regular inner class.