• Post Reply Bookmark Topic Watch Topic
  • New Topic

need help with compilation errors  RSS feed

 
Venkitachalam sj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm getting 3 errors on compiling this code.....

the statement: image=bufferedimage; shows 2 errors- cannot assign a value to final variable image and cannot find symbol error
and thecall to super must be first statement in constructor.......
what to do??

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the JavaRanch.

Please UseCodeTags when posting code. It will highlight your code making it much easier to read. I've added them for you since you're new.

The problem is that you're trying to assign a value to an initialized final value which isn't allowed. Final variables can only be assigned once.

Edit: I would make the anonymous class a normal class and pass the image as a constructor parameter. That will fix most of your problems.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!