I am trying to make an object that has int in parameters, thats sends the value to another class, sets the value of the int to a private int in a constructor of another class and using the private int to set the size of an array, but i dosnt work... Does anyone know why? Below is an example of what i mean, i want to set the arrays size to 10.
main class: Car bmw = new Car(10);
Car class: public Car (int x)
{ y = x;}
private int y;
private String[] carArray= new String[y];