• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why won't this compile?  RSS feed

 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused by the errors. The code looks fine to me.



errors:

\project2\Sales.java:35: ';' expected
for(int i = 0, inventory.hasNext(), i++) {

\project2\Sales.java:45: illegal start of expression
}

project2\Sales.java:44: ';' expected
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The clauses in a "for" are separated by semicolons ( not commas (,).
 
Jesse Crockett
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh good! thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!