The question reads: "(#226)All exceptions inherit from:" The choices were exception error and throwable. Technically all exceptions extend java.lang.exception, as well as java.lang.throwable, so both of those choices should be correct. The question only excepts an answer of java.lang.throwable ray
Consider: <code><pre> throw new Exception("A plain old Exception");</pre></code> Does this object inherit from Exception? I'd say no, it is an exception. It's an exception which does not inherit from Exception. Maybe others interpret "inherit" a bit differently though. If you want to be safe, just drop the Exception option. (I was going to suggest "extend" instead of "inherit", but there are ambiguities there too with direct extension vs. indirect extension.) You can put in java.lang.RuntimeException and java.lang.BaseExpression instead. Or Java.lang.Tossable.
"I'm not back." - Bill Harding, Twister
Paul Caudle
Ranch Hand
Joined: Jun 08, 2000
Posts: 64
posted
0
Perhaps you could just invert the question, placing what was the answer in the top, and the question as the answer. Like this: Which class inherits from java.lang.Throwable? java.lang.Exception java.lang.RuntimeException java.lang.Error all of the above none of the above Me, I would choose all of the above. Anyway, just a suggestion
[This message has been edited by Paul Caudle (edited June 15, 2000).]
Paul, A better way to frame this question would be to ask the person to pick the class that is NOT part of the inheritance hierarchy of an exception class. ----------------------------------------------------------------- (#226) All exceptions inherit/extend from the classes below, except 1. java.lang.Throwable 2. java.lang.Error 3. java.lang.Exception ----------------------------------------------------------------- Deepak
[This message has been edited by Deepoo (edited June 15, 2000).]
In reading all this I had an idea. How about What is the root class for the type of object that can be used in a catch statement? Exception RuntimeException Error Throwable Catchable Whaddya think?
Paul Caudle
Ranch Hand
Joined: Jun 08, 2000
Posts: 64
posted
0
Sounds good to me. I like it. I say go for it
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6911
posted
0
Except that "Object" is the root class of everything, and is not on the list!
How about making the question a little broader. "What class to all Errors and Exceptions inherit from?" and have the same three options. Errors do not inherit from java.lang.Exception, but do inherit from Throwable. What do you think?
Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
Angela, I think that makes the question easier! I want these questions to be tough! I also want them to be accurate and unambiguous. Frank, I think you are right, I should add Object to the list too. The key being that you cannot catch any Object.
I made the change, but I'm worried that it all might be too big for the applet now. Can somebody go through the applet and try to find this question again and see if it is okay?
Angela Poynton
Ranch Hand
Joined: Mar 02, 2000
Posts: 3143
posted
0
I don't know if you intended thiis but all I see is: What is the root class for the object used in the catch statement java.lang.Throwable; java.lang Error; Did you intend to give more options?