constructors with exceptions
807600Jun 4 2007 — edited Jun 5 2007i have to create a class TornadoException with two constructors, one default, if the exception is thrown with the default constructor the method getMessage should return "Tornado: Take cover!"
the other constructor has a single parameter int m, if the exception is thrown with this constructor the getMessage should return "Tornado: m miles away!"
I also have to write a driver class that creates two objects, one with each constructor, and use a random number to choose which object to throw. and write a catch block that catches the exception and prints the string returned by the getMessage method.
this is a hw assignment and im not sure hw to approach it, it doesnt seem to be defined well, what am i supposed to put in the try block? any help would be great.
Thanks,
Peter