Example of System::Collections::Generic::LinkedList [noobie]

  • Thread starter Thread starter sejong510
  • Start date Start date
S

sejong510

MSDN has an example of creating a LinkedList populated with String
objects:
http://msdn2.microsoft.com/en-us/library/he2s3bh7.aspx

But, how would you have a LinkedList of a created class?
LinkedList<CreatedClass> ll = new LinkedList<CreatedClass>();

class CreatedClass {

.... // Specifically, what interface, if any, does this class need to
implement?

}

Thanks.
Ps. I did search Google for it, but ended up with vague references to
__typeOf(CreatedClass) or Of CreatedClass but nothing that gives an
overview of the .NET LinkedList class with user-created objects.
 
This is a VB group, you probably want to post to
microsoft.public.dotnet.languages.vc instead.

But, how would you have a LinkedList of a created class?

What's a "created class"?


Mattias
 
Just any object. Sorry for the confusion.

e.g.
If you want a list of nodes you would create a class:

class Node {
....
}

In order to do this in Java, I would have to implement the Comparator
interface and the method "compare" in the class Node in order to take
advantage of the linked list methods.

Just not sure how to do it with the
System.Collections.Generic::LinkedList class under C++ in the .NET
framework.

Again, just looking for an extremely simple example that uses a user-
defined class as a typename (NOT the String, etc, built-in-classes).
 
Back
Top