TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdelbasset Barkat
NA
4
3k
Why the code give me an error
Apr 13 2014 5:38 PM
Hi there
I have this code
public class NodeList<T> : Collection<Node<T>>
{
public NodeList() : base() { }
public NodeList(int initialSize)
{ // Add the specified number of items
for (int i = 0; i < initialSize; i++)
base.Items.Add(default(Node<T>));
}
public Node<T> FindByValue(T value)
{ // search the list for the value
foreach (Node<T> node in Items)
if (node.Value.Equals(value)) return node;
// if we reached here, we didn't find a matching node
return null;
}
}
source :
http://msdn.microsoft.com/en-US/library/ms379572(v=vs.80).aspx
i
n visual studio 2010 c# language it gives me an error in
public class NodeList<T> :
Collection
<Node<T>>
so I change it to I
Collection
and then the error jump to base.items , exactly with items
so what is wrong ... it is from msdn.microsoft
Reply
Answers (
3
)
How to choose a number among an arrangements of numbers
List of stringbuilders from stringbuilder's lines