October 2017
Beginner
318 pages
7h 26m
English
We're going to need a loop so that our user can input more than one string to the program. For now, let's just use an infinite loop. It will run forever, but while we're building our program and debugging it, we can always just stop it manually:
while(true)
{
}
Each time our loop runs, we're going to want to use the nextLine() function on our Scanner variable, that is, reader, to grab a new line of input from the user that we're going to store in our ArrayList.
When we're working with object data structures, that is, data structures that have code wrapped around them, and functions and methods of their own, we're generally not going to have to deal with the individual indices of memory, which can be pretty nice. Instead, ...
Read now
Unlock full access