Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lottery Generator Error

 
Rebecca Plumb
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



[B]ERRORS:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method printASetOfLotteryResults() is undefined for the type LotteryDrawing
Syntax error on token "void", @ expected
printASetOfLotteryResults cannot be resolved to a type
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement

at LotteryDrawing.main(LotteryDrawing.java:8)
[/B]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your compilation problem is primarily just misplaced/missing braces. If you align your indentation more carefully, you will see how these are (not) lining up.

Also, you can't return a value from a method with a return type of void. And if you do have a return statement, then that's where the method exits, so any code following it will be unreachable.
[ April 14, 2008: Message edited by: marc weber ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic