import javax.swing.JOptionPane;
public class rationaltest
{
public static void main(String arg[])
{
try{
rational r1=new rational(1,0);
rational r2=new rational(1,1);
r2.add(r1);
 JOptionPane.showMessageDialog(null,r2.toString(),
     "rational number class",JOptionPane.PLAIN_MESSAGE);
   }  catch(dividebyzeroException e1)
   {  JOptionPane.showMessageDialog(null,e1.toString(),"ERROR",JOptionPane.ERROR_MESSAGE);}   

     
}
}