posted 16 years ago
Well, this line
Will give an error something like that, because there are a couple of missing things. A method declaration has to include the return type, and the argument list has to include the types of the arguments.
As far as the return type goes, your method has return statements that return a LinkList, and others that return nothing. You can only return nothing from a method that declares a "void" return type, and you can only return a LinkList from a method that declares it returns LinkList or a superclass of LinkList. I guess "LinkList" is the right return type, but some of your return statements will have to change.
As far as the arguments go, that's easy: the method takes two LinkLists as arguments, so we need to declare that. All together, this line would look like
Another problem I see right away is at the end of the method:
You're going to get an error that says the last line is "unreachable", which means that after the return, the method will have come to an end, and the last line can never be executed. You might want to replace both lines with something like