Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Lottery Generator Error

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

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(
Posts: 11343
Mac Safari Java
  • 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 ]
Do not threaten THIS beaver! Not even with this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic