0

constructor with array parameter. Internal array is assigned values as indicated by the parameter. An example of the use of this contructor is:
- int values[] = {2,5,7};
- IntSet a = new IntSet(values); // create a set with elements{2,5,7}


im very very confused on his wording, i dont know if im supposed to creat an array within an array or what he is wanting me to do here. please help me understand this

my guess is..

public IntSet(int values[])
{
     IntSet a = new IntSet(values);
}

Edited by jigglymig1: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Momerath
0

Read the problem carefully:

Internal array is assigned values as indicated by the parameter.

You will need a private array, determine its size when the constructor is called and assign the values as stated. Your example does not use an internal array.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.