I want to make a program that keeps getting string input and only stops when "." is entered, any ideas how to make it?
I understand that I need to make a string array, but what's the length I'm gonna give it if I dont know how many strings the user will enter?
This is my first time to use this website, so excuse me for any mistakes.
Thank you.
Edit: Here's a code that is confusing me. I keep entering dots but the for loop never breaks. Also the length is currently 10, how can I make it unlimited until the input is a dot?
Scanner s=new Scanner(System.in);
String[] x = new String[10];
for(int i=0;i<10;i++)
{
x[i]=s.next();
if(x[i]==".")
break;
}