Results 1 to 2 of 2
Thread: Getting object type
- 01-20-2008, 07:51 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 17
- Rep Power
- 0
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.
Expected output:Java Code:ArrayList a1 = new ArrayList(); a1.add("Honda"); a1.add("Toyota"); a1.add(2); a1.add(new Date());
Please advice.Java Code:Honda - String Toyota - String 2 - int Sun Jan 20 07:50:28 CET 2008 - Date
- 01-20-2008, 08:49 AM #2
Examine this.
Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)
Similar Threads
-
Operator < cannot be applied to java.lang.Object, Object
By Albert in forum Advanced JavaReplies: 2Last Post: 11-26-2010, 02:12 AM -
List views, a type of object
By Leprechaun in forum New To JavaReplies: 2Last Post: 02-06-2008, 03:07 AM -
Need help with creating array of type object
By riz618 in forum New To JavaReplies: 3Last Post: 01-29-2008, 06:14 AM -
How to cast an Object into a specific type (Integer/String) at runtime
By mailtogagan@gmail.com in forum Advanced JavaReplies: 2Last Post: 12-03-2007, 01:04 PM -
Creating object of Type Object class
By venkatv in forum New To JavaReplies: 3Last Post: 07-17-2007, 03:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks