MyException.javaPackage fengbolai;
Public class myexception extends throwable {public string getMessage () {return "my error";}} a.javaPackage fengbolai;
Public class a {
Public void myfunction () throws myexception {throw new myexception ();}} B.javaPackage fengbolai;
Import java.io. *; public class b {
Public static void main (string [] args) {a a = new a (); try {a.myfunction ();} catch (myexception me) {system.out.println (me.getMessage ());}}}