Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
also ich hab ne lineare liste und die ausgabe soll über enumeration erfolgen. ich muss dann ein object zurückbekommen, dass ich umwandle und dann mittels System.out.println ausgeben
Eunmeration enum = vector.elements();
while(enum.hasMoreElements() {
String s = (String)enum.nextElement();
System.out.println(s);
}
class Element
{
protected Element next;
protected Object value;
public bool hasNext()
{
if(this.next == this)
{
return false;
}
else
{
return true;
}
}
public Element getNext()
{
if(this.next == this)
{
return null;
}
else
{
return this.next;
}
}
public Object getValue()
{
return this.value;
}
}
class VerketteteListe
{
protected Element aktuellesElement;
public bool hasNext()
{
return this.aktuellesElement.hasNext();
}
public Object getNext()
{
if(this.aktuellesElement.hasNext())
{
this.aktuellesElement = this.aktuellesElement.getNext();
return this.aktuellesElement.getValue();
}
else
{
return null;
}
}
}