Cześć Wam. Potrafi ktoś wyjaśnić czemu nie mogę wyłapać tego wyjątku i program się nie kompiluje? Oto kod. Specjalnie popełniłem błąd - próbuję przypisać stringa do miejsca gdzie powinien być integer.
class Tablica
{
int y;
int[] x = new int[10];
public Tablica(int[] x, int y)
{
for (int i = 0; i < x.Length; i++)
{
x[i] = y * 2 * i;
}
}
}
class Program
{
static void Main(string[] args)
{
int[] arr = new int[10];
int multi = "x";
try
{
Tablica x = new Tablica(arr, multi);
}
catch(SystemException e)
{
Console.WriteLine("Blad ogolny");
Console.WriteLine(e.Message);
}
}
}