ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Understanding JAXB: Java Binding Customization
Subject:   Polymorphic behaviour problem
Date:   2003-12-25 14:58:18
From:   anonymous2
Hi,
I still did not understand how you would achieve polymorphism. Say you have an external class Shape like
public class Shape {
protected Color color ;
protected Color getColor() { return color ; }
protected void setColor(Color color) { ... }
}


Now if you have your Rectangle,Square,Circle extending this base class, how would you avoid the "instanceof" to do "processing of the Shapes" since all the Widgets have different attribs ?


1 to 1 of 1
  1. Polymorphic behaviour problem
    2003-12-26 12:32:10  hashimisayed [View]

1 to 1 of 1