Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List to HashMap?

 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method which presently returns a List.

Now my method needs to return (account, status) instead of just account.

I am thinking I need to change the method to return hashmap instead of list.

Can anyone suggest me better solution?

Thanks!
 
Campbell Ritchie
Sheriff
Pie
Posts: 49777
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a beginner's question . . .
Can you incorporate status and account into a single object?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What sort of object is account ? Can you not add a status field to it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic