Provided this is Java, you could use reflection if you really wanted that...
return Class.forName("packageName.Listener"+theNumber).newIsntancenewInstance(); Of course, doing so might have adverse effects too - performance hit, ugly code, debugging and readability issues, having to deal with handling multiple kinds of exceptions...
Recommended reading: