<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>