File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Adding Elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Adding Elements

amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
How t add elements of any data type in Stacks,ArrayList,HashTable,HashMap,HashSet, etc of util package?

Thanks advance who ever answers this question.

amit bhadre
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You can put anything extending the Object class in Collections like ArrayList, Stack... Search the API to know which method to call.

[My Blog]
All roads lead to JavaRanch
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

Please don't post the same question multiple times. If you get an answer you don't like, then provide followup information in the same thread. here is the first time you asked about this. I'm closing this later thread.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Adding Elements
It's not a secret anymore!