I was just going through some examples of UML Diagram, being translated into Java, and I I'm stuck in I am giving illustrations as a reference:
< P> Since I am very new in Java programming, I do not understand anything in this code: Why do I have to add Linkedist? Tie on the right corner of the garage: What does tier mean? (Gehege = Zoo, Tiere = Animal in German)
and
public square Gehege & lt; T extended range & gt; {Private Ent. Compatit; Private double grosses; Private linked list & lt; T & gt; Tiere; Public gehege (int kapajitaet, double groesse) {this.kapazitaet = kapajitaet; This.groesse = groesse; } Public Zero addTier (T level) {if (this.kapazitaet> this.groesse.size) {this.tiere.add (tiere); } And {new exceptions RunTimeException ("full"); }} Public Zero Deletion Tier (T level) {this.tiere.remove (tier);}}
This means that code> Tier is templatized with Gehege
. Although everything is syntactically correct, that is not true. There are different types of Gehege
that are different types of things? This is not very right! Take an example of
list
. The list
is templatized because there can be a list of different types of items - list
of car
, list
of < Code> Book etc. Apply the same object to gaage
- the argument falls flat so in my opinion the design is not correct in the right way.
Comments
Post a Comment