aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting error as Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting error as "cannot be resolved to a type"" Watch "Getting error as "cannot be resolved to a type"" New topic
Author

Getting error as "cannot be resolved to a type"

Prince khurana
Greenhorn

Joined: Mar 30, 2013
Posts: 6
Getting error: Encode cannot be resolved to a type on Line no. 25

where am I doing wrong ?


Here is my code:
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10372
    
    8

You forgot to import the Encode class or the package containing it


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4388
    
    8

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
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10372
    
    8

Ah. My bad. Encode is an inner class. Didn't notice it. Thanks for the indentation Matthew.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting error as "cannot be resolved to a type"