File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Type mismatch: cannot convert from Image to Image[] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Type mismatch: cannot convert from Image to Image[]" Watch "Type mismatch: cannot convert from Image to Image[]" New topic
Author

Type mismatch: cannot convert from Image to Image[]

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

Eclipse 3.6.2 is complaining that it cannot convert an Image to an Image[], and, I need to read an Image, rather than an Image[]




Further information at Java Tutorial (Oracle) - Arrays.


Jon
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

CardIcons[i] is an Image[] and you're trying to assign an Image to it. By the way: variable name should start with an lowercase letter.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10912
    
  12

if you have an egg, can you make it an egg carton?

No.

it's the same thing here. You can't just cast an Image to an Image[] as they are not the same thing.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Type mismatch: cannot convert from Image to Image[]
 
Similar Threads
reading a private method within a class
Overriding equals() method within a subclass
cannot read a Collection of a custom class as a parameter
static insights?
Arraylist insights