You aren't allowed to create methods inside of other methods (as far as I know).

You can create anonymous classes, though and these can have methods inside of them.

public class Test
{
...