0
How to create an array with size that entered by the user?
4 odpowiedzi
+ 8
I'm not familiar with Java but, please try searching on "google" for these kind of simple questions.
Anyways, Like vector in C++ you can implement ArrayList data structure in Java for user input sized arrays.
Read more.
https://www.geeksforgeeks.org/arraylist-in-java/amp/
To implement user input sized arrays in JS.
https://stackoverflow.com/questions/1748794/is-there-an-arraylist-in-javascript
+ 6
https://www.sololearn.com/Discuss/177056/?ref=app
Ask question in proper format
Please use search bar you will get similar questions.
+ 5
May I ask which language are you trying to achieve this in? You tagged both Java and JS, so it wasn't directly clear to us.
+ 2
You must use something like this :
String[] yourArray = new String[sc.nextInt()];
Here a complete code:
https://code.sololearn.com/cTPJBbC5WMgy/?ref=app