Draw on the right, write (Umple) model code on the left. Analyse models and generate code. This tool stores your data in cookies and on a server. I understand. Click to learn about privacy. Download Donate For help: User manual Ask questions Report issue
//The class Shape contains an abstract //method, area, as well as a concrete //method move, which has its implementation //shared across all subclasses //Shape is an abstract class, because it //contains an abstract method class Shape { color; Integer x; Integer y; abstract Double area(); void move() Java { /* implementation */ } } //Both Square and Circle are concrete //classes as they implement all inherited //abstract methods class Square { isA Shape; Double width; Double height; Double area() Java { return getWidth()*getHeight(); } Double area() Python { return self.getWidth()*self.getHeight() } } class Circle { isA Shape; Double radius; const Double PI = 3.1416; Double area() Java { return PI*radius*radius; } Double area() Python { return self.PI*self.radius*self.radius } } class A { Square s; Circle c; void Test() Java { //The method implemented in Shape is //used s.move(); c.move(); //The methods implemented in their //respective classes are used s.area(); c.area(); } void Test() Python { # The method implemented in Shape is # used self._s.move() self._c.move() # The methods implemented in their # respective classes are used self._s.area() self._c.area() } }