Java-Aufgabe SchiffDemo.java

Zurück
public class SchiffDemo{
  public static void main(String[]args){
    Schiff s1=new Schiff();
    s1.name="Günther";
    ref=s1;
    System.out.println(s1.name);
    while (ref.next !=null){
      ref=ref.next;
    }
    ref.next= new Schiff();
}

class Schiff{
  String name;
  Schiff next;

}}