This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting error as "cannot be resolved to a type"  RSS feed

 
Prince khurana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting error: Encode cannot be resolved to a type on Line no. 25

where am I doing wrong ?


Here is my code:
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You forgot to import the Encode class or the package containing it
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've fixed the indentation, which was inconsistent, and doing that makes it clearer what the problem is.

I think you probably intended the Encode class to be an inner class of Hashnain. But you've actually made is an inner class of Image. So on line 25 there's no available class called Encode.

On a similar matter - you really ought to be consistent in your use of braces {..}. You can have the opening brace on the same line as the previous statement or on it's own line, but for the sake of anyone who has to read your code, don't mix and match!
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. My bad. Encode is an inner class. Didn't notice it. Thanks for the indentation Matthew.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!