Matthew Brown wrote:And:is incorrect - the bit in < > must be a type, not a variable.
Output C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:15: illegal start of type
for (int x = 0; x < 10; x++)
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:15: illegal start of type
for (int x = 0; x < 10; x++)
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:15: <identifier> expected
for (int x = 0; x < 10; x++)
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:23: illegal start of type
for (int x = 0; x < 10; x++)
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:23: illegal start of type
for (int x = 0; x < 10; x++)
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\TestSeven.java:23: <identifier> expected
for (int x = 0; x < 10; x++)
^
6 errors
Tool completed with exit code 1
NOTE: By the way the copy to clipboard option on this forum does not seem to work with my laptop, I am using Google Chrome.
Greg Brannon
Bartender
Joined: Oct 24, 2010
Posts: 530
posted
1
An equivalent declaration/creation and initialization of your array would have been:
Did you mean to write your code inside a method? Maybe a main() method? It doesn't have to be main(), but it should be in a method.