You're probably referring to what happens when one defines nested/inner/anonymous classes inside another class's java source file.