This blog demonstrates how to draw a template class in UML followed by its equivalent Java code and looking at it you'll notice that the Java code is all about generics. I guess that's because UML's template class idea stems from C++'s template classes, which are similar to, but not a direct equivalent of Java's generics.
public class MyList<T> {
public String method1(T arg0) {
// Add some real implementation here!
return "Hello world";
}
}
No comments:
Post a comment