المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Getting a value from a constructor



C# Programming
03-20-2010, 05:34 AM
Hello,

I created an object "polzisce" from a class called Matrika(this is class that creates two dimensional array) and it's constructor takes two parameters.
Those two parameters are actualy X an Y axis and they are not fixed size.

public class Matrika
{
//constructor
public Matrika(int x, int y)
{
int[,] matrika = new int[x, y];
}
}

static void Main(string[] args)
{
Matrika polzisce = new Matrika(5, 5);
}


The question is:
Is object "polzisce" actualy two dimensional array after it is created?
How can i get that two-dimensional array "matrika" from constructor?

Thanks! Alen.