I'm trying to figure out how to make a constructor that will create a new array with parameter x as the size of the array.
Here is what I mean:
public class ArrayClass{
public String[] elements = new String[];
public ArrayClass(int x) {
'length of array' = x;
}
I tried to experiment with some of the syntax I know but couldn't figure it out.
Would appreciate some help, thanks in advance!