java - Getting an Array List from Another Object -
i'm bit stuck part of assignment , hoping might able show me i'm going wrong.
i'm building unsophisticated itunes programme , working on method musicians involved particular track , display them string (e.g. "frank black, joey santiago, kim deal" etc.) method needs work retrieving array list within artist object , displaying it.
i'm having problem get()
method though. know should implement get()
method track object can access fields in artist object, ways i've tried have sent error messages. far, i've tried enhanced 'for loop' this:
(string fellow member : members.getmembers() ) {
where 'members' arraylist
contains string
each of musician's names, sends "cannot find symbol - variable members". tried this:
(string fellow member : artist.members.getmembers() ) {
but says "non-static variable members cannot referenced static context". feeling i'm missing pretty basic here. of have thought might be...?
if members arraylist holding strings, should this
for (string m: members){ }
or
for (string m : artist.members){ }
which ever applicable situition
java
No comments:
Post a Comment