Help on LinkedList class

I am using LinkedList class in my program. My problem is I am not able add two records to a single node. I am able to add single element to each node. But my program requires to add two records to a single node.Any help is welcomed
[252 byte] By [Periwala] at [2007-10-2 0:43:33]
# 1
When you say two "records" do you mean two data elements? If so, create a container class for the data elements and add the class instance to the LinkedList.
InigoMontoyaa at 2007-7-15 16:58:21 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks for the help. I am trying it.
Periwala at 2007-7-15 16:58:21 > top of Java-index,Java Essentials,Java Programming...
# 3
How can I create a container class that holds two data elements and thn add it to a linkedlist.
Periwala at 2007-7-15 16:58:21 > top of Java-index,Java Essentials,Java Programming...
# 4

<spoonfeeding mode>

public class Person {

Person(String name, int age) {

this.name = name;

this.age = age;

}

public String getName() {

return name;

}

public int getAge() {

return age;

}

public String toString() {

return name + " " + age;

}

String name = null;

int age = -1;

}

Here is an example of a container class containing two data elements.

Person person1 = new Person("Zelmoid Sleaze", 42);

Person person2 = new Person("Melvin Kowsnowski", 24);

This is how you create instances of the class. Now you simply add these instances to a LinkedList.

</spoonfeeding mode>

mvantuyla at 2007-7-15 16:58:21 > top of Java-index,Java Essentials,Java Programming...