This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes Convert ArrayList to List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Convert ArrayList to List" Watch "Convert ArrayList to List" New topic

Convert ArrayList to List

Anwarul Kabir

Joined: Dec 17, 2008
Posts: 6

I have this arrayList and I need to return this as List<TransactionSummary>.

Is there any way I could load the data from arrayList to List<TransactionSummary>

my ArrayList which is called list is doing this


The method parseResultSetRow() is returning TransactionSummary type.

Hope this makes sense.

BTW you probably can tell i am very new at this... so please hlp.
Henry Wong

Joined: Sep 28, 2004
Posts: 20166

An ArrayList IS-A List. There is no need to convert it. Just return the ArrayList as the List.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 44585
And welcome to JavaRanch
I agree. Here's the link:
subject: Convert ArrayList to List
It's not a secret anymore!