This sounds like an assignment that
you should be doing, so any help provided here will be general in nature.
public static void printList(LinearNode L)
{
// how do i output the list to the file here??}
public static int countList(LinearNode L)
{
// how do i count the number of items on the list here
// using a recursive method??
}
The answer to this depends on what class LinearNode is and does, about which we know nothing. Have you checked its API to see if there may be helpful methods in it?