• Post Reply Bookmark Topic Watch Topic
  • New Topic

which type of collection is suitable for below scenario?  RSS feed

 
Raghu Sha
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which type of collection is suitable for below scenario?

A) session.getAttibute("userPref",dad_re);
possible values inside session are rad_eu,tcd_nid,aa,iod_po

B)Need to compare with below set of values

dad_re
rad_eu
aad_vv
bbd_rt
ccd_ff

If matched
sysout("Matched values"+rad_eu)
else
sysout("Non matching with B"+tcd_ni)

A - will contain only one value for each time and it is superset

Which collection will use to store B?
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
almost any.
i would use Array or ArrayList probably.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!