| Author |
Some "True or False", mock exam questions
|
Costa lamona
Ranch Hand
Joined: Sep 24, 2006
Posts: 102
|
|
Hi "Is-a relationship always rely on polymorphism." The Mock exam consider it true, but I think it is false, while its vis-versa is true. "Is-a relationship always require at least two classes" The Mock exam consider it true, but I think it is false, except if interface is considered a class in this context What do you think ?? please be sure before answering "A has B and B has C, this implies A has C" True or false ??? please be sure before answering Thanks
|
SCJP 5
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Originally posted by Mohammed EL-Adawi: ... "Is-a relationship always rely on polymorphism." The Mock exam consider it true, but I think it is false, while its vis-versa is true...
Any type IS its own type (e.g., a String IS-A String), and this is not polymorphism. Also, every type IS-AN Object, but inheritance alone is not polymorphism. So I would say you're correct (unless we want to debate whether "IS-A" implies/requires upcasting).
Originally posted by Mohammed EL-Adawi: ... "Is-a relationship always require at least two classes" The Mock exam consider it true, but I think it is false, except if interface is considered a class in this context...
An interface is not a class. If that's what the question author had in mind, I think they should have used the word "types" rather than "classes." But even so, an Object IS-AN Object (which brings us back to the upcasting question).
Originally posted by Mohammed EL-Adawi: ..."A has B and B has C, this implies A has C" True or false ??? please be sure before answering...
Well, it depends what you mean by "sure," but this question always seems good for a debate centered on what "has" means. [ November 18, 2006: Message edited by: marc weber ]
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Costa lamona
Ranch Hand
Joined: Sep 24, 2006
Posts: 102
|
|
Thanks marc I mean by sure, "you have read it" and you are not guessing like me. I prefer to not see such question in the exam
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Originally posted by Mohammed EL-Adawi: ...I prefer to not see such question in the exam
These particular questions are a bit vague in their phrasing and leave room for interpretation. Expect real exam questions to be more precise than this.
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
Hi Have I even mentioned my dislike for poor and vaguely worded mock exam questions? "Is-a relationship always rely on polymorphism." This question is non-sensical. As was said before, and Object is-a object. There's no polymorphism there. "Is-a relationship always require at least two classes" What is the difference between an orange? A bicycle, because it has no sleeves. Is-a requires two TYPES. A Type can be a class or an interface. So if the Markable interface extends Serializable, Markable is-a serializable object. There, you have an is-a relationship without any classes. "A has B and B has C, this implies A has C" I have a girlfriend and my girlfriend has vd. Does that mean I have vd? Nope. I have a brain, and my brain has thoughts. Does this mean I have thoughts? Yes it does. This question does not distinguish between composition and simple association. If this is speaking about association, then it if false. If it is dealing with composition, then it is true. Man, those questions suck. My 2 cents worth. -Cameron McKenzie [ November 18, 2006: Message edited by: Cameron W. McKenzie ]
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
John Johnson
Ranch Hand
Joined: Nov 05, 2006
Posts: 39
|
|
|
"Is-a relationship always require at least two classes", NO. Class can be itself (String IS-A String).
|
 |
 |
|
|
subject: Some "True or False", mock exam questions
|
|
|