JavaCompilerCore/examples/OldExamples/hama/test3o.jav
2013-10-18 13:33:46 +02:00

21 lines
335 B
Java
Executable File

class List<A>{
List <A>next = new List();
A object = null;
A getObjectAt(int n){
if(n==0){
return object;
}
else{
return this.next.getObjectAt(n-1);
}
}
void insert(A object){
if(this. Object == null){
this.object = object;
}
else{
this.next.insert(object);
}
}
}