Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Stuck with Java method

Name: Anonymous 2007-02-12 5:54

Hello, I am currently working on a Java program and I have come across a bit of a problem. I am using an interface and two classes to make a list of objects. The program currently includes an interface List, a class ConsList which implements List and contains an object "first" and a ConsList "rest", as well as a class EndList implementing List which contains an object "last" and is used to terminate the list. An example of use would be:
List l = new ConsList(foo,new ConsList(foo2, new EndList(end)));

All classes implementing List need to have a shiftRight(object o) method, which puts "o" at the beginning of the list, and removes the last object from the list. I have been trying to write this for a while now, but as I am not exceptional at Java the proper method definition continues to elude me. I would greatly appreciate any help. Thank you in advance.

Name: Anonymous 2007-02-12 14:05

>>1
lol you're rewriting Common Lisp in Java? How stupid are you? Languages are supposed to make your life easier, not translate some concepts from one language to another lol

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List