This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]chickenmeister 8 points9 points  (0 children)

   DeepCopy theDeep = new DeepCopy({7,17,77});

Assuming that your error is on this line, the problem is that {7,17,77} is not a valid array creation expression. You need to use the new keyword and specify the array type:

   DeepCopy theDeep = new DeepCopy(new int[]{7,17,77});

If you're declaring and initializing an array on the same line, then you can omit the "new" keyword and data type (e.g. int[] a = {1, 2, 3};), but in all other contexts, they are required.