• Post Reply Bookmark Topic Watch Topic
  • New Topic

private methods/ hashmaps  RSS feed

 
Brenda Stevens
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create a private method which would allow 'dinosaurs' to be added to the collection which has been created. For the dinosaurs i have created a HashMap, so i now need to create a private method which will allow the dinosaurs to be added to the hashmap which has been created
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what have you done so far? Please ShowSomeEffort.
 
Kiaamaa Liammes
Ranch Hand
Posts: 32
Eclipse IDE Java Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Kiaamaa:
Please don't provide the answers directly. As the description of this forum says: We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
 
prem pillai
Ranch Hand
Posts: 87
Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Wouter Oet mentioned , just throwing a question without showing what you have done so far doesn't help always. Take care of that aspect..

Now probably this is what you are asking for


Note: I have typed this code directly in to message . Just check if it compiles :-)
 
Kiaamaa Liammes
Ranch Hand
Posts: 32
Eclipse IDE Java Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brenda

It is a good idea to do some research yourself, before you ask a question , if you are trying to learn about HashMap , a good idea would be do some googling and try out some examples. Please use the forum to learn something specific , and give enough information about your doubt. It would be helpful not only to you but also for anybody else who might have similiar issues later.
 
Brenda Stevens
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help. I will try this and see if it compiles. Your example has been an eye opener. I have done background research on hashmaps, its just that i havent done programming in a while and it has slightly slipped my mind. once again thank you
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!