+ 2
How do i write a code for a single dimensional array that does not have an estimated size, i.e depending on the user's input.
7 odpowiedzi
+ 2
If you are looking for adjustable as needed, ArrayList is a class that allows adding or removing as you get instructed by the user.
+ 2
here a bit of example
int size;
scan.nextInt(size);
int[size]array
+ 1
Can't you make the array after the user inputs something?
+ 1
okay, so how do i go about that
+ 1
thanks,
+ 1
yes something like this, how do go about it?
+ 1
Here is a tutorial on it:
https://www.callicoder.com/java-arraylist/