how can i save the content of a linked list to a file, plzzz help me :confused:

You could serialize it.

You could serialize it.

how can i serialize it :rolleyes: . I'M creating a simple text editor using doubly linkedlist.I've created a WordNode and sored each word in a node but i need to save the content of the linked list to a file!! :o

Serialization isn't difficult. Here is the Java Tutorial on Object Serialization.

A few things to keep in mind with serialization. Every object that you want to serialize must implement the Serializable interface. Since you're working with LinkedList you must make sure that the list you're working with implements that interface and all the objects you're storing in the list implement Serializable too.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.