I Have a method that finds max and average from array of objects and returns it, but im getting NullPointerException at b.Brzina and a.Brzina and Im not sure how to fix that.
string foo = metoda();
Console.WriteLine(foo);
Console.ReadKey();
static Auto[] niz = new Auto[3];
public static string metoda()
{
var max = niz.Max(b => b.Brzina);
double avg = niz.Average(a => a.Brzina);
string autoo = "najbrzi auto je" + max.ToString() + "a prosecna brzina je" + avg.ToString();
return autoo.ToString();
}