#APCS Question
18 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @fringe needle! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
if you check the docs of the list interface, you will find out, that set method returns previously set element:
https://docs.oracle.com/javase/8/docs/api/java/util/List.html#set-int-E-
that's why in first loop it returns names of students (they are strings, so are ok for print method)
but in second loop it returns only Alex
because they all were set to Alex
So it’s possible to print out the student set method??
Wait set method returns stuff???
that's what I told
and sent the link of docs
Returns:
the element previously at the specified position
and since it's list of String elements
you can print it
Ohh ok thank you
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
np 😉
could you close the post please?