Reputation: 1671
public class A{
public A(int num){ num += 2;}
}
public class B Extends A{
public B(int num){ super(num);}
}
public class C Extends B{
public C(int num){ super(num);}
}
How would something like this look as a UML class diagram? normally if only one class inherited from another, then I would use generalization. How would I take this on? A sample diagram would be great.
Upvotes: 0
Views: 6784
Reputation: 24464
public class A{
int num;
public A(int num){
this.num = num+2;
}
}
Anyway, this change is invisible on the class diagram
A class can easily have even two children, not a problem, in any language. The same for several generation generalization. In UML you can even have two parents of a child. But only few languages support this. Java is not in their number.
Upvotes: 1