The question came up whether an IS-A relationship requires two classes, and the answer I got back was that yes, they do. But is an interface a class? My understanding is that interfaces, not supporting constructors, are not to be considered classes. Discuss...
Costs matter. Justice lies in processes not outcomes. Crime is caused by criminals.
Discussions about the "is-a" relationship are by definition conceptual and language-independent. If you use the word "class" in such a discussion, it's not the same as the Java keyword "class", which refers to a specific language feature.
If you want to have the same discussion specifically in the context of Java, you could either be pedantic and say "class, interface, or enum" whenever you mean "class" -- or you can just continue to say "class" and let it be understood that you mean that in the broader, object-oriented design sense.
Is-a relationship happens when there are two classes.When we say ObjectA is a Object B, it invloves two classes . Interface is not class, but it is blue print of what you can do with the objects of the class that implements that interface. Eg. if we take a set of alphnumeric keys as an interface. The interface has english alphabets, numbers and soem extra keys. The computer class when implements this interface we use it in a bit diferent way as comaped if it is implemented by a cell phone class. We cannot say a cell phone is a computer because it implements the same interface. This is a weak relationship we can say cellphone is a kind of computer.
On the other hand. If we have class called Processor. Computer extends Processor and PDA also extends Processor.
so we can ssay PDA is a Computer.Its a strong relationship and we are usign two class for it.
"alpa_pathak" We do have a naming policy here at the ranch which is not optional. Your screen name must consist of a first name and last name which must not be obviously fictitious. Please note, user accounts not adhering to the naming policy stand a good chance of getting suspended. You are expected to adjust your your screen namebefore you post next.