Regards
Azrael Noor
Jesper de Jong wrote:Those two words are not really common words that Java developers use, as far as I know. At least, I've never heard people calling implementing an interface "realization", and extending a class is really the opposite of generalization; a subclass is a specialized version of its superclass, not a generalized one.
Regards
Azrael Noor
Azrael Noor wrote:
but i also read
Generalization is the process of extracting shared characteristics from two or more classes,
and combining them into a generalized superclass <------- Don't we use this in JAVA ?
Azrael Noor wrote:Generalization is the process of extracting shared characteristics from two or more classes,
and combining them into a generalized superclass <------- Don't we use this in JAVA ?
Azrael Noor wrote:Generalization : means Extending a Class
Azrael Noor wrote:
Jesper de Jong wrote:
Generalization is the process of extracting shared characteristics from two or more classes,
and combining them into a generalized superclass <------- Don't we use this in JAVA ?
A superclass is a generalized form of one or more sub-classes. The examples above are good enough to explain the theory.
Junilu Lacar wrote: If you use an IDE that has refactoring utilities like Eclipse, this is pretty easy to do: in the editor, you would highlight the method you want to move to a superclass, right click, then select Refactor -> Pull Up.
Regards
Azrael Noor
The quieter you are, the more you are able to hear.
Jesper de Jong wrote:The other way around: Suppose that you didn't have the class Animal at first, but you did have different classes for different animals, such as Dog and Cat. Now you decide to take the parts that are common to dogs and cats and you put them in a common superclass Animal (you make Dog and Cat extend Animal). You could call that generalization.
Regards
Azrael Noor