I can't even compile that, much less get the message you expect to print out. I believe it won't compile because the first class is defined within the same method that you call new first(). I think solving that problem comes first. I can get it to compile and print the message if I move the declaration for the "first" class outside of the declaration of the tst class. Like so:
The text is not printed because the code doesn't compile. :roll: The code doesn't compile because the class first is a local inner class, i.e. a local declaration. It must therefore be declared (defined) before it is referenced. Moving the call to the constructor first() to after the local class definition, as in Michael's example, allows the code to compile and produce the expected output.