syntax error
Java
2
Posts
1
Posters
14
Views
1
Watching
-
This is my entire class. The compiler keeps saying 'Illegal start of type on the "for" loop. My question is, what is wrong? import java.util.*; public class wordsNoun extends wordsArrayClass { final int nounMax = 4; final String noun[] = {"boy", "girl", "dog", "town", "car"}; for( int i = 0; i <= nounMax; i++) { addElement(noun[i]); } }
-
This is my entire class. The compiler keeps saying 'Illegal start of type on the "for" loop. My question is, what is wrong? import java.util.*; public class wordsNoun extends wordsArrayClass { final int nounMax = 4; final String noun[] = {"boy", "girl", "dog", "town", "car"}; for( int i = 0; i <= nounMax; i++) { addElement(noun[i]); } }