2

I m having a Class suppose Function

I m writing such code

class FunctionsList
{

  public ArrayList<Function> functionList // this resuls in error while in Java i have done same
  { 
     get;
     set;
  }
}

while Function class is defined below

public class Function 
{
   public String Name
   {
         get; set;
   }

   public String Signature
   {
         get; set;
   }
}

where i m doing wrong in C# pls tell

1
  • List<Function> or IList<Function> or IEnumerable<Function> Commented Jul 27, 2011 at 6:18

2 Answers 2

4

I .NET you need to use List<Function>. The class ArrayList only exists in a non generic version and essentially has been superseded by List<T>.

Sign up to request clarification or add additional context in comments.

1 Comment

dont worry, we can accept answer only after 10 mins perhaps not before that we can mark it as answered. Anyways Thanks a lot . :)
1

In C# an ArrayList is an array of objects and doesn't have a generic class.

You might consider using other generic containers as

List<T>, 
Collection<T> 
HashSet<T>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.