• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error codes (syntax error on token "void", @ expected)  RSS feed

 
Shan Kulkarni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
syntax error on token "void", @ expected




Error by last curly bracket:

Multiple markers at this line
- Syntax error, insert "enum Identifier" to
complete EnumHeader
- Syntax error, insert ")" to complete
Modifier
- Syntax error, insert "EnumBody" to
complete EnumDeclaration
- Syntax error, insert "}" to complete
ClassBody
- Syntax error, insert "}" to complete Block
 
Stevens Miller
Bartender
Posts: 1444
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Shan.

Looks like you've got a couple of problems. First, your main method has to be inside a class, so try moving Lines 6-14 to just under Line 18. Second, your main method and your MovingDisk class are both missing their final "}" characters. Try adding those and let's see what happens next.
 
Shan Kulkarni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the corrected code with the changes as you stated:



When i try to run it, it still gives me an error of :

Error: Main method not found in class MovingDisk, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

 
Knute Snortum
Sheriff
Posts: 4081
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is your error message:
public static void main(String[] args)


And here is your main method:

Do you see the problem? Sometimes carefully reading the error message is all you need.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!