Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

How can I add other beans Bean.getappr() and Bean.getComm() to the same hashtable htappdetails

  Asked By: Keana    Date: Feb 06    Category: Java    Views: 1540
  

I have a arraylist appdetails.

This arraylist contains the beans Bean.getApp1(),Bean.getappr() and
Bean.getComm()
I want to add to hashtable htappdeatils. exAppBean bean1 = new exAppBean();
AppBean Bean = new AppBean();

I have a key for hashtable htappDetails
(String)Bean.getMon()+(String)Bean.getyear()

for(int j=0; j<appdetails.size();j++) {


Bean = (bean1)appdetails.get(j);
htappDeatils.put((String)Bean.getMon()+(String)Bean.getyear(),Bean.getApp1())
}

How can I add other beans Bean.getappr() and Bean.getComm() to the same
hashtable htappdetails for the same key?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Anuja Shah     Answered On: Feb 06

are u even sure wat u r looking to do
first... u cant add  multiple objects against the same key
2nd.. what do u expect the hash table to return when ask value for that key..
3rd.. why do u need so many objects against one key

 




Tagged: