Hello all. This is my first post! I am trying to teach myself a little Java. I have no coding experince.
Anyway, is there a way to pass a character array to a new method? I am trying to create a "virtual 3d box." After the box has been created I want the user to enter a number which will change the box dimensions. (One Number will change both the height, width, and length). How do I pass my "this.box" character array to my growBox method? The character array are the dimensions of the box which I set as [1][1][1. After the user inserts the factor he wants to grow the box by I want to return the new dimensions to the main method. Your help would greatly be appreciated.
public class Box {
private char [][][] box;
public void main(String[] args) {
this.box= new char [1][1][1];
}
public int[][][] growBox(int height, int width, int length){
Scanner boxChange1 = new Scanner(System.in);
System.out.println("By which factor would you like to grow the box?");
int box = boxChange1.nextInt(); //Is this right?
return box
}
}