Does the code compile? Add a println statement in the loop to print out each word that is obtained from the array so you can see that all the values are looked at.
When it compiles without error,...
Type: Posts; User: Norm
Does the code compile? Add a println statement in the loop to print out each word that is obtained from the array so you can see that all the values are looked at.
When it compiles without error,...
The contents of an array don't change how you use a loop.
See the links in post#2
Your starting in the middle and working outwards. Yes, you will use a loop and an if statement.
Look at how to use loops and arrays:
The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
Arrays (The Java™ Tutorials > Learning the Java Language > Language...