• Post Reply Bookmark Topic Watch Topic
  • New Topic

Syntax errors  RSS feed

 
Natalie Oliver
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to figure out the syntax errors in my code!!!

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a few problems here.

1) You are mixing up the comment syntax
2) The main method return type
3) string isn't the name of a class, but it is close.

How many of them can you find/fix given these clues?
 
Fred Kleinschmidt
Bartender
Posts: 571
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two more errors near the end of line 16
 
Liutauras Vilda
Sheriff
Posts: 4928
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Natalie

That is a homework for you to learn. It seems you have been given already quite a lot hints.
However, have you tried to look at compile time errors messages? Any useful information can be parsed from there?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37513
554
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the homework assignment. It says there are seven errors. I think we should refrain from pointing out the other two. We've already done more of the poster's homework than we probably should have...
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:. . . It says there are seven errors. . . .
It can't count.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Jeanne Boyarsky wrote:. . . It says there are seven errors. . . .
It can't count.

LOL

Two hardest things in programming:
1. Cache invalidation
2. Choosing good names
3. Off-by-one errors
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't even off by one.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wouldn't the easiest way to find Syntax error to be compiling it?

Record what the first error is. Fix it, then recompile. (There is no point in listing anything beyond the first error, since the compiler often gets confused)

then wash, rinse, repeat, until there are no more errors.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!