How to take array from user without initializing it's size? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to take array from user without initializing it's size?

26th Jul 2020, 7:50 AM
Vishal Sunil Rajput
3 Answers
0
For example: while(scanner.hasNextLine()){... your code ...}
26th Jul 2020, 8:03 AM
JaScript
JaScript - avatar
0
According me.., array initialization, Only 2 ways : Ex: 1 int arr[] = new int[ 10] ; Ex2 : int arr[] = { 1,2,3,4,5} ;
26th Jul 2020, 12:35 PM
Jayakrishna 🇮🇳
0
I guess you are looking for this https://stackoverflow.com/a/61478968/12512406
1st Aug 2020, 5:45 PM
Abhimanyu Gupta
Abhimanyu Gupta - avatar