• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.Error: Unresolved compilation problem  RSS feed

 
Omri lo omer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i try to lunch this is shows up (sorry for my bad english):
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
This method requires a body instead of a semicolon

at HELLOWORLD.main(HELLOWORLD.java:4)
and the code is :

what i need to change  ?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Omri lo omer wrote:
This method requires a body instead of a semicolon

what i need to change  ?


The error message is pretty clear... you terminated your main() method with a semicolon, when it is expecting a block.

Henry
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

There are a number of basic syntax errors in your code.

First of all, on line 4, you should have an opening { instead of a semi-colon ; at the end of the line.

You also need to check your spelling. In line 10 you declare a variable named CheakZugi but in line 18 you spell its name incorrectly: CheackZugi.

In lines 21 and 23, the strings you are passing to System.out.println must be in double quotes. "Like this".
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please don't try running code where your IDE has a red mark against the code. Hover your mouse over the red mark and you shou‍ld see an error message.

Never write == true nor == false. Both are poor style and error‑prone if you write = by mistake.
 
Omri lo omer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you guys !!!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!