• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why wouldn't this compile  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Please help me in understanding this?

Why wouldn't this code snippet below compile.

Eclipse is giving me this error.

Multiple markers at this line
- Syntax error on token ";", , expected
- Watchpoint:HomeZone [access and modification] - s

Thanks,
Tony Singarayar
 
Sheriff
Posts: 11495
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 4 is an assignment statement and needs to be inside a code block. Right now it's immediately inside your class definition and that's not allowed. If you create an instance method or an initialization block and move that line into that, the code will compile.
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Tony Singarayar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Junilu,
I was breaking my head for 1 hr because of this..
Thank you very much.
Tony Singarayar
 
Tony Singarayar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you campbell!!
 
Campbell Ritchie
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!