Randall Twede wrote:i have never heard that a sub-class cannot throw a new exception. of course i dont know everything. and YES you can have as many public classes as you want(not in the same file though i dont think, but the code doesnt explicitly say they are the same file), but one of them must include a main() method(he might have a third class with main() in it that he didnt post). and you dont NEED package statements, although they have a use.
Paul Clapham wrote:
Anissa Pary wrote:It throws me null pointer exception however when I commenting out my super(name) it works Is problem in Exception that I throw in subclass but do not throw in superclass???
If you get an exception thrown at run-time, the best strategy is to look at the exception and see what it says. Picking a random feature of your code and trying to blame that feature is not likely to be a good strategy at all.
So. What does the exception say? Post the whole stack trace.