Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...
Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...
Classi astratte ed interfacce - Dipartimento di Ingegneria Informatica ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Interfacce - Gerarchie<br />
A. Longheu – Linguaggi M-Z – Ing. Inf. 2009-2010<br />
Ad esempio, una “Lista” ha un concetto <strong>di</strong> sequenza, <strong>di</strong><br />
or<strong>di</strong>ne fra i suoi elementi<br />
esiste quin<strong>di</strong> un primo elemento, un secondo, …<br />
quando si aggiungono nuovi elementi bisogna <strong>di</strong>re dove<br />
aggiungerli (ad esempio, in coda)<br />
è possibile recuperare un elemento a partire dalla sua<br />
posizione (il primo, il decimo,…)<br />
public interface List extends Collection {<br />
public boolean add(int posizione, Object x);<br />
public Object get(int posizione);<br />
...<br />
}<br />
26