Answer to Question #811 in C# for Richard

Question #811
How to initialize the class fields before calling of the constructor?
1
Expert's answer
2010-10-21T08:23:27-0400
One can use inline-initialization:
class
{
//inline initialization
ArrayList = new ArrayList();
public Test()
{
//The field array is already initialized
array.Add("1");
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal