Can userdefined exception have two methods in it?

Yes a user defined exception can have any number of methods in it.

A user defined exception is nothing but a Java class created for a specific purpose. Just like ordinary Java classes, you can have any number of methods in it...