Skip to content

Instantly share code, notes, and snippets.

@rjayako
Created March 21, 2011 02:39
Show Gist options
  • Save rjayako/878935 to your computer and use it in GitHub Desktop.
Save rjayako/878935 to your computer and use it in GitHub Desktop.
try{
Room room = new Room(-1,-1,-1);
}
catch(IllegalArgumentException e){
System.out.println(e.getMessage());
//JOptionPane.showMessageDialog(null, e.getMessage(), "Troll", JOptionPane.ERROR_MESSAGE);
}
public Room(double len,double wid,double hei) throws IllegalArgumentException
{
if (len <= 0||wid<=0||hei<=0)
{
throw new IllegalArgumentException("Can not be less that zero");
}
else
length = len;
width = wid;
height = hei;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment