29 lines
360 B
Java
Executable File
29 lines
360 B
Java
Executable File
class Listststst4<A>
|
|
{
|
|
A objec = null;
|
|
Listststst4<A> next = new Listststst4();
|
|
|
|
void insert(A obj)
|
|
{
|
|
if(this.objec == null)
|
|
{
|
|
this.objec = obj;
|
|
}
|
|
else
|
|
{
|
|
this.next.insert(obj);
|
|
}
|
|
}
|
|
|
|
A getObjectAt(int n)
|
|
{
|
|
if(n == 0)
|
|
{
|
|
return this.objec;
|
|
}
|
|
else
|
|
{
|
|
return this.next.getObjectAt(n-1);
|
|
}
|
|
}
|
|
} |