title: How to dynamically pass arguments as varargs in Java
body: <p>I'm trying to write a program that will take an unknown number of arrays as input from the user and then print from them, the function that I wrote that print takes in varargs.</p>
  
  <p>So what I'm trying to do is in my main method call <code>print(arr1, arr2, arr3...)</code> and dynamically change that so I don't have to set a restriction on how many arrays can be passed in. </p>
  
  <p>My initial thought process was to store all the arrays in a 2d ArrayList and then unpack them, much like how JavaScript has the spread operator where you can have a 2d array and then do <code>print(...inputArrays)</code>, but it doesn't seem like Java allows this.</p>