The following code gives errors:
public class SomeClass
{
private int a;
private int b;
private int c;
private int[] values;
public SomeClass()
{
a = 1;
b = 2;
c = 3;
values = {a, b, c};
}
public static void Main()
{
SomeClass sc = new SomeClass();
}
}
I want values to contain a,b, and c.
I also tried initializing the array outside of the constructor like this.
private int[] values = {a, b, c};
and initializing it fully inside the constructor like this:
int[] values = {a, b, c};
but none of these do the trick.
newkeyword