View Single Post
  #1 (permalink)  
Old 01-20-2008, 09:51 AM
gapper gapper is offline
Member
 
Join Date: Jan 2008
Posts: 17
gapper is on a distinguished road
Getting object type
I have an arraylist with String, int and Date objects in it. I want to display the contents of the arraylist along with the object types of those contents.

Code:
ArrayList a1 = new ArrayList(); a1.add("Honda"); a1.add("Toyota"); a1.add(2); a1.add(new Date());
Expected output:
Code:
Honda - String Toyota - String 2 - int Sun Jan 20 07:50:28 CET 2008 - Date
Please advice.
Reply With Quote
Sponsored Links