-3

How can I make my code work in a way that the size of an array is set to my input?

Scanner myScanner = new Scanner(System.in);
final int size = myScanner.nextInt();
int[size] numberHolder = {};
Oleg Cherednik
  • 17,377
  • 4
  • 21
  • 35
Papito
  • 1

1 Answers1

-1
Scanner myScanner = new Scanner(System.in);
final int size = myScanner.nextInt();
int[] numberHolder = new int[size];
Oleg Cherednik
  • 17,377
  • 4
  • 21
  • 35