File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
How to retrieve particular object from criteria list, I do not want object array
Joined: May 10, 2011
May 18, 2011 06:21:16
I am getting exception
Exception in thread "main"
: [Ljava.lang.Object; incompatible with com.dto.AppDTO2
for(Iterator it = li.iterator();it.hasNext();)
AppDTO2 appDTO2 =
System.out.println("ID: " + appDTO2.getCATEGORY());
System.out.println(" Name: " );
Joined: Oct 13, 2005
May 18, 2011 11:27:50
. . . and the iterator is finding an Object type object. You are telling it that is a com.dto.AppDTO2 object, and it isn't. Hence the Exception.
I agree. Here's the link:
subject: How to retrieve particular object from criteria list, I do not want object array
Generics - need help
Dynamically determine Arraylist content type using reflection
How can i check if an Object is empty
Collections copy error
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015