This content has been marked as final. Show 6 replies
Simplest explanation: an ArrayList is created that can hold only BufferedImage objects. If you try to store an object that is not a BufferedImage, the compiler will tell you it cannot be done.
It creates an ArrayList which can only contain BufferedImages. A better way to write this is use an interface rather than a concrete class to declare the variable or field.1 person found this helpful
I suggest you spend some time reading about and trying to understand generics as this is the simplest use case I can think of. There are far more complex examples.
List<BufferedImage> bufferedlist=new ArrayList<BufferedImage>();
ok thanks but
in following code what are ImageColumnBean and Column:
<q>ArrayList<ImageColumnBean> recolimagelist=new ArrayList<ImageColumnBean>();
ArrayList<Column> columnobjlist=new ArrayList<Column>();</q>
How could we know that?
Moderator advice: Please read the announcement(s) at the top of the forum listings and the FAQ linked from every page. They are there for a purpose.
Then edit your posts and format the code correctly. What made you imagine that enclosing code in <q> </q> tags would do the trick?
Use the API doc of the classes you're using